Welcome Guest, Not a member yet? Register   Sign In
A more-useful uri_to_assoc
#3

[eluser]xwero[/eluser]
I wonder if it wouldn't be better to alter the (slash_)segment and (slash_)rsegment methods to accept a string which is the key of the key-value pair?
Code:
function segment($n, $no_result = FALSE)
{
    if(is_string($n) && ($key = array_search($n,$this->segments)) !== false)
    {
       $n = $key+1;
    }
    
    return ( ! isset($this->segments[$n])) ? $no_result : $this->segments[$n];
}
The _get_vars method of the extended class does some strange things to end up with the same value as the default value of the ®uri_to_assoc method? Maybe i'm not awake enough to understand it.


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



Theme © iAndrew 2016 - Forum software by © MyBB