Smarty support for Symfony's Templating component.
Templating Smarty can be installed with Composer by adding it as a dependency to your project's composer.json file.
{
"require": {
"robloach/templating-smarty": "*"
}
}
Please refer to Composer's documentation for more detailed installation and usage instructions.
Instantiate the engine:
use RobLoach\TemplatingExtras\SmartyEngine;
$parser = new Symfony\Component\Templating\TemplateNameParser();
$templating = new SmartyEngine($parser, array(
'template_dir' => '.'
));
echo $templating->render('hello.smarty', array('firstname' => 'Fabien'));
Hello, {$firstname}!
See Symfony's documentation on Templating for more information about using the different template engines available.