I use zend framework to develop my project. I want to get base url with its protocol in some model. I try following lines to do that. But it return empty.
$front = Zend_Controller_Front::getInstance();
$baseUrl = $front->getBaseUrl();
echo $baseUrl;
Can i get base url from that way. What are the best solution to do that. I can use also following line.
$baseUrl = 'http://'. $_SERVER['HTTP_HOST'];
echo $baseUrl;
But i want best solution. Please help me.