Welcome Guest, Not a member yet? Register   Sign In
CI Router Class...?
#4

[eluser]PhilTem[/eluser]
You should be able to get the current controller via

Code:
$this->router->fetch_class();

in your controller (won't work in a library, but will also work in models). For libraries and helpers you need to do something like

Code:
get_instance()->router->fetch_class();

Since $this in scope of controllers refers to the CI super-object (i.e. to get_instance()) you cannot use $this->CI in your controllers as it is not even set Wink


Messages In This Thread
CI Router Class...? - by El Forum - 10-02-2012, 05:49 AM
CI Router Class...? - by El Forum - 10-02-2012, 07:45 AM
CI Router Class...? - by El Forum - 10-03-2012, 02:24 AM
CI Router Class...? - by El Forum - 10-03-2012, 05:35 AM
CI Router Class...? - by El Forum - 10-03-2012, 07:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB