Handle in controller category, subcategory,page_name |
(12-05-2014, 07:20 PM)scion Wrote: So task is: I have attempted to handle the issue stated by the forum link several different ways: http://www.testsite.com/category/sub-category/page-name http://www.testsite.com/category/page-name http://www.testsite.com/page-name Updating the routing, hooks, etc...I came to the conclusion, it was never clean and ultimately "broke" codeigniter's way of doing things. For a Minimum.. make sure the first Segment is a controller Then in that controller use the _remap function, by placing the below in your controller, it will check to see if the second segment is an actual method inside the controller, if not you can make it run a function all the time passing parameters. Remap information: https://ellislab.com/codeigniter/user-gu...llers.html PHP Code: public function _remap($method, $params = array() ) I would come up with a generic format you like to handle controller/method_or_variables and stick with it. so the above would be http://www.testsite.com/category/sub-category/page-name http://www.testsite.com/category/page-name http://www.testsite.com/pages/page-name |
Messages In This Thread |
Handle in controller category, subcategory,page_name - by scion - 12-05-2014, 07:20 PM
RE: Handle in controller category, subcategory,page_name - by trentramseyer - 12-06-2014, 04:32 AM
RE: Handle in controller category, subcategory,page_name - by scion - 12-06-2014, 08:10 AM
|