PHPackages                             takemo101/laravel-simple-templa - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. takemo101/laravel-simple-templa

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

takemo101/laravel-simple-templa
===============================

Laravel Simple Templa

v0.1.5(3y ago)1563MITPHPPHP ^8.0

Since Feb 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/takemo101/laravel-simple-templa)[ Packagist](https://packagist.org/packages/takemo101/laravel-simple-templa)[ Docs](https://github.com/takemo101/laravel-simple-templa)[ RSS](/packages/takemo101-laravel-simple-templa/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (8)Versions (8)Used By (0)

The Simple Templa For Laravel
=============================

[](#the-simple-templa-for-laravel)

[![Testing](https://github.com/takemo101/laravel-simple-templa/actions/workflows/testing.yml/badge.svg)](https://github.com/takemo101/laravel-simple-templa/actions/workflows/testing.yml)[![PHPStan](https://github.com/takemo101/laravel-simple-templa/actions/workflows/phpstan.yml/badge.svg)](https://github.com/takemo101/laravel-simple-templa/actions/workflows/phpstan.yml)[![Validate Composer](https://github.com/takemo101/laravel-simple-templa/actions/workflows/composer.yml/badge.svg)](https://github.com/takemo101/laravel-simple-templa/actions/workflows/composer.yml)

This package is a wrap of Simple Templa for Laravel.
A Scaffold function using Simple Templa has also been added.

Installation
------------

[](#installation)

Execute the following composer command.

```
composer require takemo101/laravel-simple-templa

```

Publish the config
------------------

[](#publish-the-config)

Publish the config with the following artisan command.
You can set filters and scaffolds from the config.

```
php artisan vendor:publish --tag="simple-templa"

```

How to use
----------

[](#how-to-use)

Please use as follows

### Simple Templa Facade

[](#simple-templa-facade)

You can use the template language by using the Facade class.

```
// Get Template object
$template = \SimpleTempla::template('{{ data.a }} {{ data.b }}');

// Run parse
echo $template->parse([
    'data' => [
        'a' => 'hello',
        'b' => 'world',
    ],
]);
// hello world

// Run parse immediately
echo \SimpleTempla::parse(
    '{{ data.a }} {{ data.b }}'),
    [
        'data' => [
            'a' => 'hello',
            'b' => 'world',
        ],
    ]
);
// hello world
```

### Scaffold

[](#scaffold)

Run the Artisan command below to generate the Scaffold class.

```
php artisan make:scaff ClassName

```

Please set the input rule and output path in the generated Scaffold class.

```
