2. Installation

2.1. Download SmartyBundle

Tell composer to add the bundle to your composer.json by running the command:

$ php composer.phar require noiselabs/smarty-bundle ~2.0

Composer will install the bundle to your project’s vendor/noiselabs directory.

2.2. Enable the bundle

Enable the bundle in the kernel:

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new NoiseLabs\Bundle\SmartyBundle\SmartyBundle(),
    );
}

2.3. Enable the Smarty template engine in the config

# app/config/config.yml
# ...
framework:
    templating:
        engines: ['twig', 'php', 'smarty']

Warning

You need to enable the php engine as well. Otherwise some services will not work as expected. See `https://github.com/symfony/symfony/issues/14719`_