Welcome Guest, Not a member yet? Register   Sign In
how to always get first parameter after method name?
#5

[eluser]wolffc[/eluser]
[quote author="xwero" date="1232779572"]
Code:
funcion first_parameter()
{
    $CI =& get_instance();
    if($CI->uri->total_rsegments() > 2) // check for more than controller/method segments
    {
       $first_parameter = $CI->uri->segment(3);
       // do whatever you want with it
    }
}
call this in the post_controller_constructor hook.[/quote]

D'oh, I was using segment(3) instead of rsegment(3) Smile I don't even need a function test since i am making the method name required.


Messages In This Thread
how to always get first parameter after method name? - by El Forum - 01-23-2009, 05:40 PM
how to always get first parameter after method name? - by El Forum - 01-23-2009, 05:49 PM
how to always get first parameter after method name? - by El Forum - 01-23-2009, 06:46 PM
how to always get first parameter after method name? - by El Forum - 01-23-2009, 10:37 PM
how to always get first parameter after method name? - by El Forum - 01-23-2009, 10:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB