From 89ed1b33638691ea5e9368dcd5973a179baa8105 Mon Sep 17 00:00:00 2001
From: admin 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. 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:Models
-
Anatomy of a Model
-
@@ -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