How to set baseUrl

I want to install baseurl in my project. I am using zend framework. But I'm new to the zend framework, and I have no idea how to install it? Please help. thanks in advance

+7
source share
4 answers

I think this is automatically done by the zend-framework .....

try to echo ............

echo $this->baseUrl(); 

He will give you the desired answer .......

+4
source

One way is through Bootstrap.php:

 protected function _initSetupBaseUrl() { $this->bootstrap('frontcontroller'); $controller = Zend_Controller_Front::getInstance(); $controller->setBaseUrl('/projects/myapp'); } 

Another way is through application.ini:

 resources.frontController.baseUrl = /projects/myapp 
+13
source

From http://framework.zend.com/manual/en/zend.controller.request.html

 $router = new Zend_Controller_Router_Rewrite(); $controller = Zend_Controller_Front::getInstance(); $controller->setControllerDirectory('./application/controllers') ->setRouter($router) ->setBaseUrl('/projects/myapp'); // set the base url! $response = $controller->dispatch(); 
+3
source

try it. In your abcd.phtml (zend framework).

  <?php echo $this->baseUrl(); ?> 
+2
source

All Articles