0 votes
in CodeIgniter by
How can you add or load a model in CodeIgniter?

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

Related questions

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