summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--user_guide/general/models.html14
1 files changed, 11 insertions, 3 deletions
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
<h1>Models</h1>
-<p>Models are <strong>optionally</strong> available for those who want to use a more
-traditional MVC approach.</p>
+<p>Models are <strong>optionally</strong> available for those who want to use a more traditional MVC approach.</p>
@@ -128,7 +127,10 @@ class&nbsp;Blogmodel&nbsp;extends&nbsp;Model&nbsp;{<br />
<a name="anatomy"></a>
<h2>Anatomy of a Model</h2>
-<p>Model classes are stored in your <dfn>application/models/</dfn> folder. The basic prototype for a model is this:</p>
+<p>Model classes are stored in your <dfn>application/models/</dfn> folder. They can be nested within sub-folders if you
+want this type of organization.</p>
+
+<p>The basic prototype for a model class is this:</p>
<code>
@@ -167,6 +169,12 @@ To load a model you will use the following function:</p>
<code>$this->load->model('<var>Model_name</var>');</code>
+<p>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 <dfn>application/models/blog/queries.php</dfn> you'll load it using:</p>
+
+<code>$this->load->model('blog/queries');</code>
+
+
<p>Once loaded, you will access your model functions using an object with the same name as your class:</p>
<code>