Try changing it to this:
$this->load->model('Book_category'); /* Get Categories */ $template_data['mainContentData']['book_categories'] = $this->Book_category->get_all_categories();
Simulation of the first letter capitalized in accordance with the CI documentation
Link: http://ellislab.com/codeigniter/user-guide/general/models.html
This is from the man page:
Model classes are stored in the application / models / folder. They can be nested in subfolders if you want this type of organization.
The main prototype for the model class is the following:
class Model_name extends CI_Model { function __construct() { parent::__construct(); } }
Where Model_name is the name of your class. Class names must have the first letter with a capital letter with the rest of the name in lower case. Make sure your class extends the base class of the model.
The file name will be the bottom version of your class name. For example, if your class:
class User_model extends CI_Model { function __construct() { parent::__construct(); } }
Your file will be as follows:
application/models/user_model.php Loading a Model
Your models will typically be loaded and called from your controller functions. To load the model, you will use the following function:
$this->load->model('Model_name');
trrrrrrm
source share