A more-useful uri_to_assoc |
[eluser]Benjamin Midget[/eluser]
Because I find it cumbersome to define the segment to start when using uri_to_assoc(n), I put together this piece that works much more like get: See the code here. It extends uri because uri is always loaded. After doing this, you can use my function like a get function. It automatically creates the associative array, no matter where in the url your controller and method are, and whether it's a re-routed url or not. Here's an example: Code: // for this example, the segments are Because URI is always loaded, you can do the following, too, inside your libraries without including the CI instance: Code: $vars = MY_URI::get(); Personally, I think this functionality ought to be added to the Core. |
Messages In This Thread |
A more-useful uri_to_assoc - by El Forum - 04-24-2009, 03:34 PM
A more-useful uri_to_assoc - by El Forum - 04-24-2009, 05:18 PM
A more-useful uri_to_assoc - by El Forum - 04-24-2009, 08:59 PM
A more-useful uri_to_assoc - by El Forum - 04-24-2009, 09:28 PM
A more-useful uri_to_assoc - by El Forum - 05-17-2009, 12:19 PM
A more-useful uri_to_assoc - by El Forum - 05-17-2009, 02:56 PM
A more-useful uri_to_assoc - by El Forum - 05-17-2009, 03:09 PM
A more-useful uri_to_assoc - by El Forum - 05-17-2009, 04:18 PM
A more-useful uri_to_assoc - by El Forum - 05-17-2009, 04:46 PM
A more-useful uri_to_assoc - by El Forum - 05-17-2009, 06:37 PM
A more-useful uri_to_assoc - by El Forum - 05-21-2009, 01:14 PM
A more-useful uri_to_assoc - by El Forum - 06-04-2009, 02:52 PM
A more-useful uri_to_assoc - by El Forum - 06-04-2009, 03:23 PM
A more-useful uri_to_assoc - by El Forum - 06-04-2009, 03:38 PM
A more-useful uri_to_assoc - by El Forum - 06-04-2009, 04:21 PM
A more-useful uri_to_assoc - by El Forum - 06-04-2009, 04:31 PM
A more-useful uri_to_assoc - by El Forum - 06-04-2009, 04:46 PM
A more-useful uri_to_assoc - by El Forum - 06-05-2009, 12:50 AM
A more-useful uri_to_assoc - by El Forum - 07-10-2009, 10:07 AM
|