Welcome Guest, Not a member yet? Register   Sign In
Including class dependencies
#5

[eluser]TheFuzzy0ne[/eluser]
I think they only use get_instance() in each function is to keep variables out of the global scope. Come to think about it, perhaps that's a good enough reason not to do it the way I'm proposing. In theory, my method will be safe, regardless of whether the file is being loaded using include/require or if it's loaded via CodeIgniter's loader. The class in this case is intended to be loaded using CodeIgniter's loader, so I can do things like:

Code:
$this->user->do_login($username, $password);
$this->user->is_logged_in(); # and so on.

I'll check it out, I just wanted to see if I was breaking any rules, or missing something blatantly obvious. Of course, the same checks and some extra code to import a reference to the other model and library can be done in the constructor.


Messages In This Thread
Including class dependencies - by El Forum - 05-14-2009, 10:05 AM
Including class dependencies - by El Forum - 05-14-2009, 12:03 PM
Including class dependencies - by El Forum - 05-14-2009, 12:13 PM
Including class dependencies - by El Forum - 05-14-2009, 01:04 PM
Including class dependencies - by El Forum - 05-14-2009, 01:30 PM
Including class dependencies - by El Forum - 05-14-2009, 01:38 PM
Including class dependencies - by El Forum - 05-14-2009, 01:53 PM
Including class dependencies - by El Forum - 05-14-2009, 02:07 PM
Including class dependencies - by El Forum - 05-14-2009, 03:05 PM
Including class dependencies - by El Forum - 05-14-2009, 03:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB