Welcome Guest, Not a member yet? Register   Sign In
Grabing Class and function name for use in a libraries

[eluser]The Casual Bot[/eluser]
hi all,

im trying to make a auth libary that will allow and diallow access the controller and function

so i trying to get the class and function name and the easy way i could think of doing this was the uri class but this seems to just return '0'

any ideas / suggestions how i can do this

i now i can pass the name in a var but want to try to avoid that

You mean the controller and method called thru the URI?

$controller = $this->uri->rsegment(1);
$method = $this->uri->rsegment(2);

Or in case you're intrested in the URI before routing

$controller = $this->uri->segment(1);
$method = $this->uri->segment(2);

[eluser]The Casual Bot[/eluser]
yeah kinda got this to work

that is what i was doing

but i had the following


clearly i didnt read the user guide as it seems by calling the class it stop it from be called

once this line was removed it started to work fine

[eluser]The Casual Bot[/eluser]
but thanks


Big Grin


Theme © iAndrew 2016 - Forum software by © MyBB