In my base controller I have:
public function fatalError($error)
{
$this->flash->error($error);
$this->dispatcher->forward(array(
'controller' => $this->di['dispatcher']->getControllerName(),
'action' => 'error'
));
return false;
}
But of course the "return false" doesn't stop execution of the action the function is called from.
I want to be able to call this from anywhere and with a single line show a controller-specific error and NOT continue the code from where it is executed (whether in an action or another function).
Is this possible?