Welcome Guest, Not a member yet? Register   Sign In
Avoiding massive controller: where to put individual files
#8

(12-28-2014, 12:23 PM)sneakyimp Wrote:
(12-27-2014, 07:33 PM)includebeer Wrote: core is to extend or replace core libraries.
model is for your data model (database classes).
libraries is for your other classes.
helpers is for file containing functions.
third_party is for files from other project used by you application.

Perhaps you could be more specific? Like perhaps delineate where core libraries differ from non-core libraries?

I should have say "core classes". CodeIgniter's core classes are in system/core

http://www.codeigniter.com/user_guide/ge...asses.html



Quote:I've heard that model files may do more than just deal directly with a database. Do helpers contain ONLY functions? Might they not contain classes?

That's the way CodeIgniter's is structured. Nothing prevents you from putting whatever you want in those files. In my models I also have functions that do other stuff than database operations. Like data validation, for example. Stuff related to the database model.

I suggest you read the User Guide to learn the basics of CI :

"Models are PHP classes that are designed to work with information in your database. For example, let's say you use CodeIgniter to manage a blog. You might have a model class that contains functions to insert, update, and retrieve your blog data."
http://www.codeigniter.com/user_guide/ge...odels.html

"Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular category. "
http://www.codeigniter.com/user_guide/ge...lpers.html
Reply


Messages In This Thread
RE: Avoiding massive controller: where to put individual files - by includebeer - 12-28-2014, 07:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB