title: How do you get Smarty3 to work with Symfony2?
body: <p>I'm trying to get Smarty 3 to work as a template engine for Symfony 2. I'm trying to install this bundle to get smarty 3 to work:</p>
  
  <p><a href="https://github.com/noiselabs/SmartyBundle" rel="nofollow">https://github.com/noiselabs/SmartyBundle</a></p>
  
  <p>It installs just fine, but when I add it to the AppKernal as it says in the installation instructions, I get the following error:</p>
  
  <blockquote>
    <p>Fatal error: Class 'NoiseLabs\Bundle\SmartyBundle' not found in >/home/kevin/workspace/Symfony/app/AppKernel.php on line 20</p>
  </blockquote>
  
  <p>where line 20 is inside registerBundles():
      new NoiseLabs\Bundle\SmartyBundle(),</p>
  
  <p>The second, possibly related problem I have is that in app/config/config.yml, if I add 'smarty' to the templating engine array:</p>
  
  <pre><code>templating:      { engines: ['twig'] }
  </code></pre>
  
  <p>it throws this error:</p>
  
  <blockquote>
    <p>ServiceNotFoundException: The service "templating" has a dependency on a non-existent >service "templating.engine.smarty".</p>
  </blockquote>
  
  <p>I realize that twig comes with symfony but for this project I need to use smarty. Am I missing something or is there another solution to this? </p>
  
  <p>Here is the Kernel code:</p>
  
  <pre><code>&lt;?php
  
  use Symfony\Component\HttpKernel\Kernel;
  use Symfony\Component\Config\Loader\LoaderInterface;
  
  class AppKernel extends Kernel
  {
      public function registerBundles()
      {   
          $bundles = array(
              new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
              new Symfony\Bundle\SecurityBundle\SecurityBundle(),
              new Symfony\Bundle\TwigBundle\TwigBundle(),
              new Symfony\Bundle\MonologBundle\MonologBundle(),
              new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
              new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
              new Symfony\Bundle\AsseticBundle\AsseticBundle(),
              new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
              new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
  //new NoiseLabs\Bundle\SmartyBundle(),
              new Blog\EntryBundle\BlogEntryBundle(),
          );  
  
          if (in_array($this-&gt;getEnvironment(), array('dev', 'test'))) {
              $bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
              $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
              $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
              $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
          }   
  
          return $bundles;
      }   
  
      public function registerContainerConfiguration(LoaderInterface $loader)
      {   
          $loader-&gt;load(__DIR__.'/config/config_'.$this-&gt;getEnvironment().'.yml');
      }   
  }
  </code></pre>
  
  <p>Here is the auto loader code:</p>
  
  <pre><code>&lt;?php
  
  use Symfony\Component\ClassLoader\UniversalClassLoader;
  use Doctrine\Common\Annotations\AnnotationRegistry;
  
  $loader = new UniversalClassLoader();
  $loader-&gt;registerNamespaces(array(
      'Symfony'          =&gt; array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
      'Sensio'           =&gt; __DIR__.'/../vendor/bundles',
      'JMS'              =&gt; __DIR__.'/../vendor/bundles',
      'NoiseLabs'        =&gt; __DIR__.'/../vendor/bundles',
      'Doctrine\\Common' =&gt; __DIR__.'/../vendor/doctrine-common/lib',
      'Doctrine\\DBAL'   =&gt; __DIR__.'/../vendor/doctrine-dbal/lib',
      'Doctrine'         =&gt; __DIR__.'/../vendor/doctrine/lib',
      'Monolog'          =&gt; __DIR__.'/../vendor/monolog/src',
      'Assetic'          =&gt; __DIR__.'/../vendor/assetic/src',
      'Metadata'         =&gt; __DIR__.'/../vendor/metadata/src',
  ));
  $loader-&gt;registerPrefixes(array(
      'Twig_Extensions_' =&gt; __DIR__.'/../vendor/twig-extensions/lib',
      'Twig_'            =&gt; __DIR__.'/../vendor/twig/lib',
  ));
  
  // intl
  if (!function_exists('intl_get_error_code')) {
      require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
  
      $loader-&gt;registerPrefixFallbacks(array(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'));
  }
  
  $loader-&gt;registerNamespaceFallbacks(array(
      __DIR__.'/../src',
  ));
  $loader-&gt;register();
  
  AnnotationRegistry::registerLoader(function($class) use ($loader) {
      $loader-&gt;loadClass($class);
  
  // Swiftmailer needs a special autoloader to allow
  // the lazy loading of the init file (which is expensive)
  require_once __DIR__.'/../vendor/swiftmailer/lib/classes/Swift.php';
  Swift::registerAutoload(__DIR__.'/../vendor/swiftmailer/lib/swift_init.php');
  </code></pre>