title: I have no access to container in my controller
body: <p>I am trying to access a service in a Symfony Controller</p>
  
  <pre><code>$session = $this-&gt;get('session');
  </code></pre>
  
  <p>But I get the next error:</p>
  
  <pre><code>PHP Fatal error: Call to a member function get() on a non-object
  </code></pre>
  
  <p>I thought that Symfony2 had the controllers defined as services by default.</p>
  
  <p><em>Note: this question was originally asked by <a href="https://stackoverflow.com/users/392684/dbugger">Dbugger</a>, but he removed it for no reason, while it was already answered.</em></p>