Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

How to create a 404 page?

hello I would like to create a simple page 404, but nothing more bone only that page is for understanding



35.6k
Accepted
answer

This will forward the dispatcher to a desired controller+action:

$di->setShared('router' ,function() use($config) {
    $router = new \Phalcon\Mvc\Router();
    $router->notFound(array(
        "controller" => "index",
        "action" => "route404"
    ));
    return $router;
});


31.5k

Thank you very much