Welcome Guest, Not a member yet? Register   Sign In
HMVC best practices to reuse code
#3

[eluser]gh0st[/eluser]
From my research and work on a Modular CMS and looking at the way PyroCMS works, you need to extend the core controllers, models via the libraries folder.

Quote:- have a base controller that other controllers inherit from that

You need a MY_Controller (it can be named anything though) that lives in Libraries. It will run before anything, you make it include the stuff you want.

Then in your Controllers you make it extend MY_Controller (or whatever you called it).

Quote:- have a base model that other models inherit from

You need a MY_Model that lives in Libraries. Make it include the stuff you want and then your models extend MY_Model.

Jamie Rumbelow did a MY_Model that has basic CRUD/active record functionality out of the box.

The link is here:
http://github.com/jamierumbelow/codeigniter-base-model/


I am not sure about the rest of the other stuff you are after.


Messages In This Thread
HMVC best practices to reuse code - by El Forum - 02-03-2010, 12:45 PM
HMVC best practices to reuse code - by El Forum - 02-03-2010, 07:42 PM
HMVC best practices to reuse code - by El Forum - 02-04-2010, 03:16 AM
HMVC best practices to reuse code - by El Forum - 02-04-2010, 04:37 PM
HMVC best practices to reuse code - by El Forum - 02-09-2010, 11:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB