Welcome Guest, Not a member yet? Register   Sign In
How to stop CI from continuing?
#11

[eluser]sophistry[/eluser]
hi mihalt,

i like the fact you are so confident. ("come on guys...") ;-)

as you may know, there are many ways to accomplish a login check. putting logic and view loading in the constructor of a "superclass" strikes me as a little bit unconventional. also, there are certain things that just don't work in a CI constructor (i recall something that simply doesn't work in PHP4, but i can't find it right now). additionally with view loading and the third parameter you have to keep those class variables and you end up with the same variable scoping issue discussed in this other recent thread: http://ellislab.com/forums/viewthread/97450/

since we are genially discussing the merits of each approach...
hooks: load a lib at proper point in CI core code, access lib anywhere after that point - easy, but results in obfuscated/invisible code.

_remap(): handle all logic in one function right at the root of the "superclass". you don't have to worry about scoping variables because except for the _remap() code everything else is like a "normal" CI code execution.

logic and view loading in constructor of "superclass": handles all logic at root of superclass - have to build infrastructure in derived classes to handle and access data and logic results of the "superclass" constructor.

your thoughts on that summary? did i hit every point? did i miss any other techniques?


Messages In This Thread
How to stop CI from continuing? - by El Forum - 11-19-2008, 01:52 PM
How to stop CI from continuing? - by El Forum - 11-19-2008, 02:53 PM
How to stop CI from continuing? - by El Forum - 11-19-2008, 03:06 PM
How to stop CI from continuing? - by El Forum - 11-19-2008, 04:50 PM
How to stop CI from continuing? - by El Forum - 11-19-2008, 04:59 PM
How to stop CI from continuing? - by El Forum - 11-19-2008, 05:49 PM
How to stop CI from continuing? - by El Forum - 11-19-2008, 06:51 PM
How to stop CI from continuing? - by El Forum - 11-19-2008, 07:17 PM
How to stop CI from continuing? - by El Forum - 11-19-2008, 07:18 PM
How to stop CI from continuing? - by El Forum - 11-20-2008, 05:51 AM
How to stop CI from continuing? - by El Forum - 11-20-2008, 07:46 AM
How to stop CI from continuing? - by El Forum - 11-20-2008, 08:29 AM
How to stop CI from continuing? - by El Forum - 04-11-2009, 03:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB