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
function beforeRender(){
$this->set('base_url', 'http://'.$_SERVER['SERVER_NAME'].Router::url('/'));
}
Is there any alternative? Means is there any global variable available to get the base url rather than this?