Welcome Guest, Not a member yet? Register   Sign In
[resolved] Get controller and function name
#1

[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
        $router =& load_class('Router');
        
        $controller = strtolower($router->fetch_class());
        $action = strtolower($router->fetch_method());


Messages In This Thread
[resolved] Get controller and function name - by El Forum - 05-09-2009, 09:40 PM
[resolved] Get controller and function name - by El Forum - 05-10-2009, 01:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB