Hello,
I just started my adventure with zend framework 1.9.1 but I encountered few issues. I would like to remove default routes to avoid displaying the same content on different URLs - to achive it I wrote custom function in bootstraper
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initMyRouter()
{
$this->bootstrap('router')
->getContainer()
->frontcontroller
->getRouter()
->removeDefaultRoutes();
}
}
but after that, one problem arise - every invalid URL reaches to default controller instead of error controller. To solve this issue I put resources.frontController.defaultcontrollername = "error" resources.frontController.defaultaction = "throw" in application.ini and
public function throwAction()
{
throw new Zend_Controller_Dispatcher_Exception;
}
in ErrorController to workaround this but my question is... am I doing something wrong?
The second issue is that I need to generate only absolute URLs so I added resources.frontController.baseurl = "http://mydomain.com/" in application.ini but after that every URL points to default controller. How to fix it?
The third (and last) is... how to call Zend_Controller_Action_Helper_Url::url in my actions? I tried something like $this->_helper->url(array(), 'frontpage') but it calls Zend_Controller_Action_Helper_Url::direct