title: Views/Resources location for Silex Twig Library
body: <p>Normally, for a Silex project, I would have top-level directories like:</p>
  
  <pre><code>- app/
     - views/
  - src/
  - vendor/
  - web/
  </code></pre>
  
  <p>Now, some of my classes may call <code>$app['twig']-&gt;render(...)</code> and it will pull out a view from the <code>app/views</code> folder. </p>
  
  <p><strong>If I extract a library to be more reusable, across multiple projects, where should I keep its view files, and how do I instruct Twig to look there?</strong></p>
  
  <p>The same question applies to graphics/stylesheets, etc which I would normally put in <code>web/</code>.</p>
  
  <p>Surely they have to be within <code>vendor/my-lib</code> somewhere to allow Composer to cleanly install the files? Is there a common/best-practice way to do this?</p>
  
  <p><strong>Update</strong>
  For reference, here's what I ended up doing:</p>
  
  <pre><code>&lt;?php
  
  // in my \Silex\ServiceProviderInterface ...
  
  /**
   * @var \Twig_Environment $twig
   */
  $twig = $app['twig'];
  
  // Add the paths to our twig templates here
  $fsLoader = new \Twig_Loader_Filesystem(array(
      __DIR__.'/views/'
  ));
  
  $twig-&gt;setLoader(new \Twig_Loader_Chain(array($twig-&gt;getLoader(), $fsLoader)));
  </code></pre>
  
  <p>Thanks.</p>