Closed pobidowski closed 8 years ago
This is by design.
For a child route to match, the full parent must match, including optional segments. This is not a bug, but because doing otherwise is quite difficult to accomplish, and prone to error.
The solution as presented on that SO post is correct: create an alternate route for the case where you want the child to match when no optional segments are available in the parent.
The issue was given here: http://stackoverflow.com/questions/12713029/zf2-optional-route-constraints-in-child-routes
It's very weird behavior. If I want to build a system with optional multilanguage support (where all links are prefixed by "/languageCode/"), it is not possible to acomplished with child routes.