Welcome Guest, Not a member yet? Register   Sign In
Extending a controller subclass
#8

[eluser]steward[/eluser]
Restriction or broken convention, it amounts to the same thing in the end. How ya gonna support front end ve backend, cron job vs home page etc. Only one level subclassing for controllers is all that can be easily accomplished with no further thought.

Neither solution seems very appealing.

In the case of including everything, I don't feel I gained any memory/space/clarity/separation. Every controller script gets every controller class definition. It may become bloated.

In the case of hard-coding require APPPATH etc: years later these will be littered throughout your scripts. Just the sort of maintenance headace conventions are meant to address.

A cursory glance at the code tells me behaviour might be modified by overriding what the router returns for fetch_directory, fetch_class and friends.

I met and modified Magento recently, my first exposure to the Zend framework. Looks like they have taken this concept and run with it: folder/naming conventions allow for more than one level of subclassing.

Needs must at this time, and I will use "require_once".

I would be interested to hear how others are thinking about this problem. Or whether it is even a problem.

In biology they have a saying "evolution is smarter than you". At the moment I am operating on the principle that "CI is smarter than me". I'm almost inclined to use neither approach and have one big fat controller.

Has anyone considered extending the router to implement a convention that takes subclassing for controllers a step further? Or found a better thought/solution.

Happy holidays to all.


Messages In This Thread
Extending a controller subclass - by El Forum - 12-01-2009, 01:05 PM
Extending a controller subclass - by El Forum - 12-01-2009, 02:46 PM
Extending a controller subclass - by El Forum - 12-01-2009, 04:33 PM
Extending a controller subclass - by El Forum - 12-01-2009, 04:55 PM
Extending a controller subclass - by El Forum - 12-01-2009, 05:58 PM
Extending a controller subclass - by El Forum - 12-02-2009, 05:06 AM
Extending a controller subclass - by El Forum - 12-02-2009, 06:11 AM
Extending a controller subclass - by El Forum - 12-30-2009, 12:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB