I'm using an admin prefix and I want to pass some parameters to my controller but I'm having a hard time with the routing.
I want to pass variable "string1" using the url like: domainame.com/admin/DumbController/string1
I want the string1 to be passed to the index method in controller (actually called admin_index in the DumbController).
If I use the url: domainame.com/admin/DumbController/index/string1 Then it works. However I would like to using the routing to direct it to the proper action.
Here is my routing related to /admin as they are in routes.php:
Router::connect('/admin', array('controller' => 'users', 'action' => 'dashboard'
, 'admin' => true));
Router::connect('/admin/dumb/:chartType', array('controller' => 'dumb',
'action' => 'index',
'prefix'=>'admin',
'admin'=>true),
array(
'pass' => 'chartType',
'chartType' => '[a-z]+'
)
);
The controller has a public admin_index($chartType=null) method. I've played with the routing quite a bit, but nothing seems to work like I expect. Can someone point me in the right direction?
Thanks!
EDIT: Added the only other admin related route, but there are about 15 as there are a lot of other things going on.