[eluser]antiver[/eluser]
I created a user helper that contains functions such as login(), logout(), authenticated(), get_user(), etc. When I went to use it (no, I didn't test it before it was done lol), it threw a fatal error that I was using $this in a non-object context. Fair enough. I was trying to use CodeIgniter's session library, and to access that, I was using $this->session.
My first thought was to try and get $this into my functions, perhaps by
Code:
//usage: login($this);
function login($that) {
$that->session->...
}
But I assume that'll just make a local copy of $this.
Now I'm thinking that I could fix my problem by rebuilding my user helper as a library, but that doesn't seem like an entirely logical solution and I was wondering if there was something I missed - where should I have written my user functions? Thanks.