summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-09-28 09:46:56 +0200
committeradmin <devnull@localhost>2006-09-28 09:46:56 +0200
commit89ed1b33638691ea5e9368dcd5973a179baa8105 (patch)
treeafd48225336d889bcc7b5a1006460d7a20d3e4a6
parente216238cbfbcc8c170f118d11f5f9d93cbb6e11c (diff)
-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>