Welcome Guest, Not a member yet? Register   Sign In
[solved - thanks!] $this->uri->rsegment(x) in a hook?
#1

[eluser]Tim Skoch[/eluser]
I'm trying to use the URI class in a pre-controller hook, but whenever I do, I get the following PHP error:

Fatal error: Using $this when not in object context in /path/to/my/ci/installation/system/application/hooks/login.php on line 3

My call from within the hook is as follows:
echo($this->uri->rsegment(1));

(bad form, I know, echoing output before headers are sent. But I'm just troubleshooting right now...)

All I need to obtain is the first segment of the URI after it has been routed.


Messages In This Thread
[solved - thanks!] $this->uri->rsegment(x) in a hook? - by El Forum - 10-13-2008, 11:26 PM
[solved - thanks!] $this->uri->rsegment(x) in a hook? - by El Forum - 10-13-2008, 11:42 PM
[solved - thanks!] $this->uri->rsegment(x) in a hook? - by El Forum - 10-14-2008, 12:01 AM
[solved - thanks!] $this->uri->rsegment(x) in a hook? - by El Forum - 10-14-2008, 10:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB