From c8b21742927c217770e950005741850f17b5d32c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 18 May 2008 03:57:40 +0000 Subject: documented load->model in the Loader docs --- user_guide/general/models.html | 2 +- user_guide/libraries/loader.html | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/user_guide/general/models.html b/user_guide/general/models.html index c0d972683..2759f0219 100644 --- a/user_guide/general/models.html +++ b/user_guide/general/models.html @@ -164,7 +164,7 @@ To load a model you will use the following function:

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'); +$this->load->model('blog/queries');

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

diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index c9b0bfee4..8cf5478e8 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -103,8 +103,16 @@ to your browser. Remember to assign it to a variable if you want the data retur $string = $this->load->view('myfile', '', true); +

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

+

$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');

+

If you would like your model assigned to a different object name you can specify it via the second parameter of the loading + function:

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

$this->load->database('options', true/false)

-

This function lets you load the database class. The two parameters are optional. Please see the database section for more info.

-- cgit v1.2.3-24-g4f1b