[resolved] Get controller and function name |
[eluser]bas_vdl[/eluser]
Hello, im writing a login module and to check if somebody has acces to a function i'm using a hook. in the hook I was reading the controller and action from the url but this is not secure. in the following situation http://localhost/welcome/ there is no function in the url so it wil load the index function but $CI->uri->segment(2) remains empty so the page wil be loaded meanwhile the user is not allowed to see the page. so how can i make sure that i get the loaded controller and funtion without using $CI->uri->segment() thank you regards Bas EDIT: found it Code: <?php
[eluser]Dam1an[/eluser]
You can also do Code: $this->router->class; If I'm not mistake, using rsegment also works as its the routed segment, not the one in the URL |
Welcome Guest, Not a member yet? Register Sign In |