php - Codeigniter - Call to member function on non-object
Get the solution ↓↓↓Solution:
Copied to answer:
I may be off, but aren't model names case sensitive? So if your model is class News_model it should be called by $this->News_model->category_exists. (though you have omitted the declaration, so this is only a guess)
Answer
Solution:
Do you have itconfig/autoload.php
?
If yes then load it in theconfig/autoload.php
file (In the bottom)
$autoload['model'] = array();
If not,load it:
$this->load->model('news_model');
The model file name must be the same as the model class name.
Check constructor with user guide too.
function __construct() { // Call the Model constructor parent::__construct(); }
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: err_ossl_pem_no_start_line
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.