title: Add custom property to all symfony2 controllers
body: <p>is there any way to preprocess controller data somehow. I'm going to take param from session, validate it and assign it as controller property and use it as $this->myVar inside actions of some controller or all of them if possible. Using controller's constructor gives me nothing, I couldn't access request and session data. Thanks!</p>
  
  <p>UPD:
  Thanks, <a href="https://stackoverflow.com/users/1178578/jkucharovic">jkucharovic</a>, very good solution.
  Also there is a bit dirtier solution, without injecting: setContainer() method, which has been called straight after $controller = new Controller();</p>
  
  <pre><code>use Symfony\Component\DependencyInjection\ContainerAwareInterface,
      Symfony\Component\DependencyInjection\ContainerInterface;
  
  class AppServiceController extends Controller {
   private $my_property;
  
   /**
    * Used as constructor
    */
   public function setContainer(ContainerInterface $container = null)
   {
      parent::setContainer($container);   
      $this-&gt;my_property = 'foo';
      // your controller code
   }
  }
  </code></pre>