LaravelPackages.net
Acme Inc.
Toggle sidebar
addons/smarty

This package lets you run Smarty4 on Laravel elegantly.

191
0
1.0.5
About addons/smarty

addons/smarty is a Laravel package for this package lets you run smarty4 on laravel elegantly.. It currently has 0 GitHub stars and 191 downloads on Packagist (latest version 1.0.5). Install it with composer require addons/smarty. Discover more Laravel packages by addons or browse all Laravel packages to compare alternatives.

Last updated

Smarty

This package lets you run Smarty3 on Laravel5 elegantly.

Installation

composer require addons/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' => [
        // ...
        'Addons\Smarty\View\SmartyServiceProvider',
    ]

Then publish the config file with php artisan vendor:publish. This will add the file config/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"}.

Comments