about router notFound method

routes.php

$router->notFound(
    array(
        "controller" => "index",
        "action"     => "error"
    )
);

IndexController.php

public function errorAction($code = '404')
{
    $this->response->setStatusCode(404, 'Not Found');
}

When i try to access for ex: /test:

TestController handler class cannot be loaded

Why router notFound method doesnt working?

Beacause by default there are auto routing working in phalcon. Just put false in Router constructor. https://docs.phalconphp.com/pl/latest/reference/routing.html#default-behavior

Beacause by default there are auto routing working in phalcon. Just put false in Router constructor. https://docs.phalconphp.com/pl/latest/reference/routing.html#default-behavior

Can i use with autorouter? Because of i want to use only show error page when router not found.

When i disable autorouter, should i add to routes all syntaxes?

You don't need to add all syntaxes, you just can add auto-route yourself. Just read docs there.