This can be done in several ways, depending on your preference. The first method is the standard Symfony2.1 method.
Add SmartyBundle in your composer.json‘:
{
"require": {
"noiselabs/smarty-bundle": "dev-master"
}
}
Now tell composer to download the bundle by running the command:
$ php composer.phar update noiselabs/smarty-bundle
Composer will install the bundle to your project’s vendor/noiselabs directory.
Add the following lines in your deps file:
[SmartyBundle]
git=git://github.com/noiselabs/SmartyBundle.git
target=bundles/NoiseLabs/Bundle/SmartyBundle
Now, run the vendors script to download the bundle:
$ php bin/vendors install
If you prefer instead to use git submodules, then run the following:
$ git submodule add git://github.com/noiselabs/SmartyBundle.git vendor/bundles/NoiseLabs/Bundle/SmartyBundle
$ git submodule update --init
Add the NoiseLabs namespace to your autoloader:
// app/autoload.php
$loader->registerNamespaces(array(
// ...
'NoiseLabs\\Bundle' => __DIR__.'/../vendor/bundles',
));
Enable the bundle in the kernel:
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new NoiseLabs\Bundle\SmartyBundle\SmartyBundle(),
);
}
# app/config/config.yml
# ...
framework:
templating: { engines: ['twig', 'smarty'] }