robloach / templating-smarty
Symfony Templating Component support for Smarty.
dev-master
2014-11-04 05:24 UTC
Requires
- php: >=5.3.0
- smarty/smarty: ~3.1.21
- symfony/templating: ~2.6.0@beta
Requires (Dev)
- phpunit/phpunit: ~3.0
This package is auto-updated.
Last update: 2024-11-10 09:17:26 UTC
README
Smarty support for Symfony's Templating component.
Installation
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.
Usage
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.smarty
Hello, {$firstname}!
See Symfony's documentation on Templating for more information about using the different template engines available.