Hi,
What is the best way to handle unexisting actions in the Zend Framework?
Depending on the controller I want to be able handle the request differently.
BR Niklas
Hi,
What is the best way to handle unexisting actions in the Zend Framework?
Depending on the controller I want to be able handle the request differently.
BR Niklas
Add this function to your controller class
public function __call($method, $args){
if ('Action' == substr($method, -6) && $method != 'indexAction') {
// If the action method was not found, forward to the index action
return $this->_forward('index');
}
// all other methods throw an exception
throw new Exception('Invalid method "' . $method . '" called', 500);
}
In this case missing actions will be forwarded to the index action
This is explained at http://framework.zend.com/manual/en/zend.controller.action.html#zend.controller.action.subclassing.example-call