Zend Framework URL Route not adding domain
got a bit of a problem with Zend not adding the base url into routes i think.
What i have is as follows:
application
modules
menu
public
menu
css
js
index.php
index.base.php
I am using the function
<?php echo $this->url(array('module' => 'module1'), 'menu-install'); ?>
With the route:
$router->addRoute('menu-install', new Zend_Controller_Router_Route('/install/:modulePath', array('module' => 'menu', 'controller' => 'insta开发者_Go百科ll', 'action' => 'install')));
Which is outputting http://menu/install/module1/ instead of http://localhost:8888/menu/install/module1/
Any ideas whats going on?
Try ro write this(in bootstrap for example)
Zend_Controller_Front::getInstance()->setBaseUrl('/');
Normally, the URL View Helper return only the URI after the without the domain ; than
<?php echo $this->url(array('module' => 'module1'), 'menu-install'); ?>
Write something like this:
/menu/install/module1/
Where:
- /menu is your "BaseURL" (.htaccess)
- /install/* is your route content
Perhaps, you have write "http://" before the ?
An other possibility is that you have a mistake with your parameters "module" and the "Module" mechanics of Zend_Framework...
Aka
精彩评论