Can I have multiple controllers in the admin of my PyroCMS module?
Let's say I have a module called xyz
.
My admin controller is here: cms/addons/shared_addons/modules/xyz/controllers/admin.php
And is accessed as follows:
http://whatever.com/admin/xyz
http://whatever.com/admin/xyz/some_method
http://whatever.com/admin/xyz/ijk
Can I create a controller that will let me use the following URLs?
http://whatever.com/admin/xyz/subcontroller/
http://whatever.com/admin/xyz/subcontroller/a_method
http://whatever.com/admin/xyz/subcontroller/b_method
If so, how would I name the controller file and class?
I've tried cre开发者_如何学Goating admin_subcontroller.php
and calling the class Admin_Subcontroller
or Admin_Xyz_Subcontroller
but neither works.
Cheers!
Add a file to your config folder called routes.php and the add something like the following:
$route['module/admin/subcontroller(:any)?'] = 'admin_subcontroller$1';
精彩评论