From 697b75e5296c4add2577db9099c235781fd34430 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 11:22:58 +0100 Subject: Changed example model name to follow the CI styleguide class naming conventions --- user_guide_src/source/general/models.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/models.rst b/user_guide_src/source/general/models.rst index 0156b0460..72acf77b4 100644 --- a/user_guide_src/source/general/models.rst +++ b/user_guide_src/source/general/models.rst @@ -16,7 +16,7 @@ blog. You might have a model class that contains functions to insert, update, and retrieve your blog data. Here is an example of what such a model class might look like:: - class Blogmodel extends CI_Model { + class Blog_model extends CI_Model { var $title = ''; var $content = ''; -- cgit v1.2.3-24-g4f1b From 149c07726bb60df65766a1046e695b1897652cc7 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 11:23:41 +0100 Subject: Changed load model examples to use lowercase model name. Fixes #1417 --- user_guide_src/source/general/models.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/models.rst b/user_guide_src/source/general/models.rst index 72acf77b4..87f63e416 100644 --- a/user_guide_src/source/general/models.rst +++ b/user_guide_src/source/general/models.rst @@ -104,7 +104,7 @@ Your models will typically be loaded and called from within your :doc:`controller ` functions. To load a model you will use the following function:: - $this->load->model('Model_name'); + $this->load->model('model_name'); If your model is located in a sub-folder, include the relative path from your models folder. For example, if you have a model located at @@ -115,14 +115,14 @@ application/models/blog/queries.php you'll load it using:: Once loaded, you will access your model functions using an object with the same name as your class:: - $this->load->model('Model_name'); + $this->load->model('model_name'); - $this->Model_name->function(); + $this->model_name->function(); 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->load->model('model_name', 'fubar'); $this->fubar->function(); @@ -133,7 +133,7 @@ view:: function blog() { - $this->load->model('Blog'); + $this->load->model('blog'); $data['query'] = $this->Blog->get_last_ten_entries(); @@ -165,7 +165,7 @@ database. The following options for connecting are available to you: defined in your database config file will be used: :: - $this->load->model('Model_name', '', TRUE); + $this->load->model('model_name', '', TRUE); - You can manually pass database connectivity settings via the third parameter:: -- cgit v1.2.3-24-g4f1b