Welcome Guest, Not a member yet? Register   Sign In
unlikely...
#4

(12-30-2015, 01:25 AM)Rashid Wrote: All in all we decided to go "altering methods" way, inserting check function call wherever necessary...

Looks like it's a downside of URI-segment routing: when there is no "&id=" you can't be sure that first param is actually an "id".

If the URI segments are well defined and consistent, you can make some assumptions that if URI segment 1 is within a set of values and URI segment 2 is within a set of values, than URI segment 3 must be an ID in order for it to be a valid URI. However, that can be cumbersome for some situations, and may not be flexible enough for some sites.

Even in the best cases, you have to assume that someone may be supplying invalid data, since the URI can be input by the user, but that's the case regardless of whether you use URI-segment routing.

You could also use the URI segments themselves as you would a query string, which is supported by the uri_to_assoc() and assoc_to_uri() methods in the URI library, but that would require modification to your controller methods or your routing.
Reply


Messages In This Thread
unlikely... - by Rashid - 12-29-2015, 10:11 AM
RE: unlikely... - by mwhitney - 12-29-2015, 10:30 AM
RE: unlikely... - by Rashid - 12-30-2015, 01:25 AM
RE: unlikely... - by mwhitney - 12-30-2015, 09:14 AM
RE: unlikely... - by cartalot - 12-30-2015, 06:56 PM
RE: unlikely... - by Martin7483 - 12-31-2015, 03:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB