Help with url routing |
[eluser]iambaz[/eluser]
Hi, How do I change the routes.php so that url's do not call the method of a controller from it's second segment? For example, I want the user to type a url like the following: www.site.com/content/the-page-title This would invoke the content controller and try to load 'the-page-title' as the method. I don't want the method to load though, I just want to run the content constructor and then use the second segment to identify the page in my database and load the content accordingly. Many Thanks
[eluser]Jônatan fróes[/eluser]
Code: $route['content/(:any)'] = 'content/index/$1'; "content" Controller Code: ...
[eluser]iambaz[/eluser]
Perfect - I had been writing it as: Code: $route['content/(:any)'] = 'content/$1'; Many thanks |
Welcome Guest, Not a member yet? Register Sign In |