$router = $di->getRouter(FALSE);
//$router = Phalcon\Mvc\Router(FALSE);
...
...
$router->notFound([
'controller' => 'index',
'action' => 'route404'
]);
...
class IndexController extends ControllerBase
{
public function route404Action()
{
$this->view->disable();
$this->response->setRawHeader('HTTP/1.1 404 Not Found');
$this->response->setContent('<b>404, bratishka :(</b>');
$this->response->send();
}
}