We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Error Preg match search route and paginator !

$router->add("/search",array(
    "module"        => "frontend",
    "controller"    => "index",
    "action"        => "search",
));

$router->add("/search/page/([0-9]+)",array(
    "module"        => "frontend",
    "controller"    => "index",
    "action"        => "search",
    'page'          => 1,
));

Here is route .

When search url like this

https://localhost/search?for=test <--- work

https://localhost/search?for=test/page/2 <--- not work because keyword is "test/page/2" and cann't paging .

So how to fix that problem ????

You have the access the routes in the same way they were defined:

/search/page/([0-9]+) accept routes such as /search/page/1 or /search/page/9292