Welcome Guest, Not a member yet? Register   Sign In
Get the requested method
#1

[eluser]RobertSall[/eluser]
Hey.

I've made a authfunction that's being called in the MY_Controller class. In every controller I have an array with permissions for each function in the controller:
var $permissions = array( 'index' => array('member') );
(Example)

Then in the function I check the segment 2 which method was requested (if none index was requested) and then check if the user's usergroup is in the permissionsarray.

So far so good, it works as I want to, but the problem is when I want to use routing, then segment 2 wont contain the requested method..

I've searched for another way to find another way to get which method was requested.

Any ideas?

Thanks
#2

[eluser]Sbioko[/eluser]
You can retrieve current method using this:
Code:
$this->router->fetch_method();
#3

[eluser]RobertSall[/eluser]
Works, thank you.




Theme © iAndrew 2016 - Forum software by © MyBB