SmartyView replaces the default Laravel View class with the Smarty Template Engine.
Included Smarty version: 3.1.13
-
Download the Source from Github.
-
Register the Bundle with Laravel In the
application/bundles.php
file, register the SmartyView bundle
'smartyview' => array(
'location' => 'smartyview', 'autoloads' => array(
'map' => array(
'SmartyView\\View' => '(:bundle)/view.php',
)
)
)
- Replace the View alias (optional)
In the
application/config/application.php
file, replace the alias with the following:
'aliases' => array(
...
View' => 'SmartyView\\View',
);
If you do not wish to replace or create the alias, you can use the Smarty template engine like this:
// app view
\SmartyView\View::make('index.test')->with('var', 'value');
// bundle view
\SmartyView\View::make('docs::test')->with('var', 'value');
[Kris Geens] (https://github.com/skmedia) for original Laravel-SmartyView bundle.