$this->uri->segment(n) |
[eluser]rossmurphy[/eluser]
I have set up a template controller that grabs the 3rd segement using Code: $this->uri->segment(3) My url looks like this Code: http://localhost/content/page/customersupport I then take the segment and call a view. Is there anyway to exclude the method so it doesnt show up in my url as page?
[eluser]tomdelonge[/eluser]
What exactly do you mean? So it could look like: localhost/content/customersupport ??? I had a similar question that was answered here: http://ellislab.com/forums/viewthread/123268/ You'd probably just need to play with your routes configuration.
[eluser]designfellow[/eluser]
Hi, Add the below line into your routes.php file to make this work Code: $routes['content/:any']='content/page/$1'; Happy Coding DesignFellow
[eluser]rossmurphy[/eluser]
Thanks designfellow, works really well. Wondering though, i've been reading the routes user guide and it says this Code: $route['product/(:num)'] = "catalog/product_lookup_by_id/$1"; Will pass whatever variable come after the product_looup_by_id in the function. So i set it up and i get $1 being passed into the method. Any ideas? Also, is this correct? or should i be using $this->segment to get the var instead of passing into method. Cheers |
Welcome Guest, Not a member yet? Register Sign In |