title: global variable from base controller symfony2
body: <p>I'm trying to intercept either the rendering function or the response
  to add a variable to it before loading the the view(twig).</p>
  
  <p>I tried to override the default render method but it
  still gives me</p>
  
  <blockquote>
    <p>Variable "myvar" does not exist in /path/to/baseAppLite.html.twig at line 10</p>
  </blockquote>
  
  <p>What's wrong with my code and is there a better way ?</p>
  
  <p>This is my override code in the <em>baseController</em></p>
  
  <pre><code>public function render($view, array $parameters = array(), Response $response = null)
  {
      $parameters = array_merge(
          $parameters,
          array(
              'myvar' =&gt; 'GlobalVar'
          )
      );
      return parent::render($view, $parameters, $response);
  }
  </code></pre>
  
  <p>Usage</p>
  
  <pre><code>{{ myvar }}
  </code></pre>
  
  <hr>
  
  <p>UPDATE:
  From what I can see is that the render function is not loading
  because i tried echoing "render bar foo" and nothing shows up</p>