in CodeIgniter by
Q:
How can you add or load a model in CodeIgniter?

▼ Show 1 Answer

0 votes
by
To load models in controller functions, use the following function:

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

If in case your model file is located in sub-directory of the model folder, then you have to mention the full path. For example, if your file location is application/controller/models/project/ModelName. Then, your file will be loaded as shown below,

$this->load->model('project/ModelName');
Learn More with Madanswer

Related questions

0 votes
asked Dec 29, 2020 in CodeIgniter by SakshiSharma
...