Welcome Guest, Not a member yet? Register   Sign In
Am I loading a class twice?
#9

[eluser]Buso[/eluser]
It wont be any performance hit, but the method (is_logged_in) could have referenced $this (the user instance) or an instance attribute and it wouldn't have worked, so the usual way is calling get_instance()->user->is_logged_in(), or using an extra helper is_logged_in(), which calls the above.

Even if it works now, the implementation of User::is_logged_in() could change, and after an update your code wouldn't be compatible with it anymore


Messages In This Thread
Am I loading a class twice? - by El Forum - 10-07-2010, 12:26 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 12:38 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 01:02 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 01:12 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 01:18 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 01:37 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 01:47 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 02:00 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 02:15 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 02:28 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 02:31 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 02:36 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 02:42 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 02:47 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 02:48 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 02:54 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 02:57 AM
Am I loading a class twice? - by El Forum - 10-07-2010, 03:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB