title: base_url in CakePHP
body: <p>In most web applications we need global var base_url. In cakephp to get base_url currently i put the following code on beforeRender method in app_controller.php</p>
  
  <pre><code>function beforeRender(){
      $this-&gt;set('base_url', 'http://'.$_SERVER['SERVER_NAME'].Router::url('/'));
  }
  </code></pre>
  
  <p>Is there any alternative? Means is there any global variable available to get the base url rather than this?</p>