Zend route objects seem to vary in appearance given certain conditions.
- Route object obtained from ControllerInstance->params()->fromRoute()
- Other Zend objects returning either a route or an array with a route seem to suffer the same problem.
- This could be a route configuration problem, but logging here for reference.
- Below I've cataloged what I've found so far.
Returned by: http://{root}.com/{url-segment}/{url-segment}
Example: http://devs.com/recent/aubricus
Note: The absence of an ending slash.
array(3) {
["controller"]=>
string(21) "Dev\Controller\Index"
["action"]=>
string(5) "index"
["devName"]=>
string(5) "aubricus"
}
Returned by: http://{root}.com/{url-segment}/{url-segment}/
Example: http://devs.com/recent/aubricus/
Note: The ending slash.
array(5) {
["__NAMESPACE__"]=>
string(15) "Dev\Controller"
["controller"]=>
string(21) "Dev\Controller\Index"
["action"]=>
string(5) "index"
["devName"]=>
string(5) "aubricus"
["__CONTROLLER__"]=>
string(5) "Index"
}
Returned by: http://{root}.com/{url-segment}/{url-segment}/{url-segment}
Example: http://devs.com/recent/aubricus/about
Note: The absence of an ending slash.
Note: This same route with an ending slash returns a 404, where the index route with an ending slash does not.
array(5) {
["__NAMESPACE__"]=>
string(15) "Dev\Controller"
["controller"]=>
string(21) "Dev\Controller\About"
["action"]=>
string(5) "index"
["devName"]=>
string(5) "aubricus"
["__CONTROLLER__"]=>
string(5) "about"
}