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

Optional route parameters

Hi! My route '/:controller/:action' is not determined as the default route. Is possible to indicate that route parameters as optional? Like this: '/[:controller][/:action']'

As far as I know the default routes are:

/:controller /:controller/:action /:controller/:action/:params

If no action is defined, the indexAction is called.



3.0k

Strangely, if I do not register this route, is generated dispatch error. https://github.com/dphn/SkeletonApplication/blob/master/module/Application/Module.php#L29

I understand that a lot of code here: ( Simply put, with this configuration are registered routes. If i comment out this route, an error occurs. Though route below - the same.