php - Use the default route with Zend Router by default -


how can configure zend_controller_router use default route default? whatever reason unknown, uses current route.

this causing annoying routing issues, , don't feel editing hundreds of links explicitly use default route reasonable solution add 1 custom route.

your question isn't obvious , confusing, try though.

i going assume not mean zend_controller_route in fact talking links generated in views.

you can use baseurl() this

<a href="<?=$this->baseurl("about-us")?>">about us</a> 

you can set baseurl in bootstrap this

zend_controller_front::getinstance()->setbaseurl("/"); 

if working locally may want set this

zend_controller_front::getinstance()->setbaseurl("/my-app/public"); 

using baseurl() in views use path base urls on. remember must wrap links in baseurl() work.

the url() helper not useful this, used doing things pagination want current parameters of request object maintained.

hope helps.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -