From 89ed1b33638691ea5e9368dcd5973a179baa8105 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 28 Sep 2006 07:46:56 +0000 Subject: --- user_guide/general/models.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'user_guide/general/models.html') diff --git a/user_guide/general/models.html b/user_guide/general/models.html index 0dd48ce98..23f62fbed 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -62,8 +62,7 @@ Models

Models

-

Models are optionally available for those who want to use a more -traditional MVC approach.

+

Models are optionally available for those who want to use a more traditional MVC approach.

@@ -128,7 +127,10 @@ class Blogmodel extends Model {

Anatomy of a Model

-

Model classes are stored in your application/models/ folder. The basic prototype for a model is this:

+

Model classes are stored in your application/models/ folder. They can be nested within sub-folders if you +want this type of organization.

+ +

The basic prototype for a model class is this:

@@ -167,6 +169,12 @@ To load a model you will use the following function:

$this->load->model('Model_name'); +

If you model is located in a sub-folder, include the relative path from your models folder. For example, if +you have a model located at application/models/blog/queries.php you'll load it using:

+ +$this->load->model('blog/queries'); + +

Once loaded, you will access your model functions using an object with the same name as your class:

-- cgit v1.2.3-24-g4f1b