Silverstripe Version: 4.1
This works great I’m just a little confused as I can’t see any docs on it.
I have a Controller: RetailController.
I have a route for it: ‘retail’: ‘RetailController’
In this controller I have a function signage_yes. I don’t have a route for it.
I do have ‘signage_yes’ in $allowed actions.
A url of retail/signage-yes does work. It finds the right controller and method despite one is hyphen and one is underscore.
So that’s all good, saves me me writing a grip of routes but why does this work and is it expected/reliable?
Edit: here’s a debug_request on it:
Debug (line 261 of RequestHandler.php): Testing ‘$Action//$ID/$OtherID’ with ‘signage-yes’ on RetailController
Debug (line 269 of RequestHandler.php): Rule ‘$Action//$ID/$OtherID’ matched to action ‘handleAction’ on RetailController. Latest request params: array ( ‘Action’ => ‘signage-yes’, ‘ID’ => NULL, ‘OtherID’ => NULL, )
I don’t have a signage-yes function in the controller.