title: how to access base url in twig from symfony 2 console?
body: <p>I am porting my website which is in Kohana to Symfony 2 gradually. Right now I am writing backend command in Symfony2, e.g. cron to send email notifications. </p>
  
  <p>How can I access base url in twig. Can I do some configuration so that accessing urls in twig from console and from http request to be same ?</p>
  
  <p>I have already reffered to this, </p>
  
  <p><a href="http://symfony.com/doc/current/cookbook/console/sending_emails.html" rel="nofollow">http://symfony.com/doc/current/cookbook/console/sending_emails.html</a></p>
  
  <p><a href="http://symfony.com/doc/current/cookbook/templating/global_variables.html" rel="nofollow">http://symfony.com/doc/current/cookbook/templating/global_variables.html</a></p>
  
  <p>here, it is given how to configure it, but it is not mentioned how to access it, I assume I have to use {{ router.request_context.host }}.</p>
  
  <p>But my question is, isn't there any way to be consistent between console and HTTP ?</p>
  
  <p>e.g. {{ url }}  ?</p>