How to differentiate between controller files/controller methods/ and controller parameters in a url. |
[eluser]CroNiX[/eluser]
Code: $route['edit_section/(:any')] = "admin/edit_section/index/$1"; So if the url was www.yoursite.com/edit_section/about_us, it would send 'about_us' to the index method of the 'edit_section' controller, overriding your default value, 'Default'. BTW, 'section' should be $section in your index method parameter.
[eluser]lanzd[/eluser]
Thank you, It took a little playing around with until I got it. The ultimate line I needed to accomplish this (for anyone reading this in the future) was this line: Code: $route['admin/edit_section/(:any)'] = "admin/edit_section/index/$1"; I put it after these two lines in "mywebsite.com/application/config/routes.php" Code: $route['default_controller'] = "welcome"; I will also create custom pages for 'default_controller' and '404_override', I'm just still developing. Thank you all again! |
Welcome Guest, Not a member yet? Register Sign In |