• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Practical Examples Using URI Segments For URL's

#5
[eluser]tonanbarbarian[/eluser]
rather than having parameters on the method, you can use the URI object to get the segments of the uri. this allows for a flexible number of parameters

Code:
$segments = $this->uri->uri_to_assoc(2);
produces an associate array of segments, which i prefer to just referencing as numbers (but that is a personal decision)
so the urls could be
{base url}/news/article/id/123/format/print
$segments would have the following
id=>123
format=>print


Messages In This Thread
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 12:02 PM
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 04:11 PM
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 04:23 PM
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 07:20 PM
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 07:30 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.