Latrell / Smarty by Latrell

This package lets you run Smarty3 on Laravel5 elegantly.
7,025
12
3
Package Data
Maintainer Username: Latrell
Maintainer Contact: i@latrell.me (Latrell Chan)
Package Create Date: 2014-04-25
Package Last Update: 2016-06-14
Language: PHP
License: MIT
Last Refreshed: 2024-12-17 03:00:44
Package Statistics
Total Downloads: 7,025
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 12
Total Watchers: 3
Total Forks: 13
Total Open Issues: 4

Smarty

This package lets you run Smarty3 on Laravel5 elegantly.

Installation

composer require latrell/smarty dev-master

Update your packages with composer update or install with composer install.

Usage

To use the Smarty Service Provider, you must register the provider when bootstrapping your Laravel application. There are essentially two ways to do this.

Find the providers key in config/app.php and register the Smarty Service Provider.

    'providers' => [
        // ...
        'Latrell\Smarty\SmartyServiceProvider',
    ]

Then publish the config file with php artisan vendor:publish. This will add the file config/latrell-smarty.php. This config file is the primary way you interact with Smarty.

Then simply reference templates using the normal dot syntax of Laravel.

For example to load smarty template views/blog/post.tpl, you would use view('blog.post').

In Smarty {include} or {extends} tags, you should continue to use the full directory syntax, e.g. {extends file="blog/post.tpl"}.