Weird Routing Problem |
[eluser]kirkaracha[/eluser]
I have these routes in config/routes.php: Code: $route['people/atoz/:any'] = 'people/atoz/$1'; Here's my atoz method in the people controller: Code: public function atoz($start_letter = NULL) { When I go to the page in a browser (www.example.com/people/atoz/b/), I get "Sorry, no people whose last name starts with $1 are listed." The $1 is rendered literally instead of the letter b.
[eluser]Dolrich[/eluser]
Try this... Im not sure it would work. Code: $route['people/(:any)/(:any)'] = 'people/details/$1/$2';
[eluser]kirkaracha[/eluser]
OK, adding parenthesis to this route worked: Code: $route['people/atoz/(:any)'] = 'people/atoz/$1'; Thanks! What do the parenthesis do? I don't see anything about them in the documentation, and I have other similar routes that work without them.
[eluser]danmontgomery[/eluser]
http://www.regular-expressions.info/brackets.html |
Welcome Guest, Not a member yet? Register Sign In |