How to set up custom routes in Phalcon?

I just stumbled upon Phalcon (the PHP framework) and it looked so promising that I decided to give it a try.

I searched in the docs but didn't find anything related to routes in Phalcon. Does anyone know how to create custom routes in this structure, or should I always follow conventions?

If you do not already know Phalcon, you can look at these slides to find out what it is about.

+7
source share
2 answers

They responded to the request and have just implemented custom routes, now it doesn’t look so good, but here is the link:

$router->add("/admin/:controller/a/:action/:params", array( "controller" => 1, "action" => 2, "params" => 3, )); 

References:

+4
source

I am sure you will have to adhere to the baseDir/class/method/argument/... convention.

I read the documentation and the source code, and I don’t see any hints that will allow you to process custom routes, relying only on extension C. One possible solution would be to map them to .htaccess.

+2
source

All Articles