I'm not sure if I'm just missing something with SS routes but I can't seem to get any working using 3.1.7.
I have a page controller "AccountPage_Controller" that extends "Page_Controller".
All I want to do is have a couple routes on this page e.g. "http://localhost/website/account/address/deleteAddress/1".
I literally copied the same example from the docs with out any luck. See my code below and the results when executed.
class AccountPage_Controller extends Page_Controller {
private static $allowed_actions = array (
'address'
);
private static $url_handlers = array(
'address/$Action/$ID' => 'deleteAddress'
);
public function deleteAddress(){
return true;
}
}
Results in (using debug_request):
Debug (line 250 of RequestHandler.php): Testing 'address/$Action/$ID' with 'address/deleteAddress/1' on AccountPage_Controller
Debug (line 258 of RequestHandler.php): Rule 'address/$Action/$ID' matched to action '$Action' on AccountPage_Controller. Latest request params: array ( 'Action' => 'deleteAddress', 'ID' => 1, )
Debug (line 250 of RequestHandler.php): Testing '$Action//$ID/$OtherID' with '' on ErrorPage_Controller
Debug (line 258 of RequestHandler.php): Rule '$Action//$ID/$OtherID' matched to action 'handleAction' on ErrorPage_Controller. Latest request params: array ( 'Action' => NULL, 'ID' => NULL, 'OtherID' => NULL, )
Debug (line 184 of RequestHandler.php): Action not set; using default action method name 'index'
Debug (line 157 of Controller.php): Request handler returned SS_HTTPResponse object to AccountPage_Controller controller;returning it without modification.
[User Warning] Couldn't set response type to 404 because of output on line 165 of /Users/USER/Sites/website/framework/dev/Debug.php
Sorry, it seems you were trying to access a page that doesn't exist.
And that's with a dev/build, dev/build?flush=all, dev/build?flush=1
Any ideas?