Welcome Guest, Not a member yet? Register   Sign In
Using (:any) in routes
#3

[eluser]mddd[/eluser]
Of course it is the responsibility of the programmer to know what he/she is doing.But I do think it can be unclear, even from reading the manual, what :any actually does.

If someone wrote $route['(:any)/(:num)/(:num)'] it would be reasonable for them to expect that this would only match something like abc123/456/789 and not somecontroller/somemethod/some-other-value/123/456.

I think this is because :any appears in the manual only in the context of 1 segment. Maybe we should expand the manual to give some examples like $route['(:any)'] will match /hallo, /123, /123/456 etc.

And also it could be useful to have a separate shortcut for the 'simple' behaviour of matching a single segment. Something like :word to match any word, including numbers, letters and other characters. Something like that.


Messages In This Thread
Using (:any) in routes - by El Forum - 05-31-2010, 02:22 AM
Using (:any) in routes - by El Forum - 05-31-2010, 02:31 PM
Using (:any) in routes - by El Forum - 06-01-2010, 12:33 AM
Using (:any) in routes - by El Forum - 08-09-2010, 07:50 PM
Using (:any) in routes - by El Forum - 08-09-2010, 07:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB