In CodeIgniter, how do you load a Model inside a Controller?

  • $model = new ModelName();
  • $this->load->model('ModelName');
  • include('ModelName');
  • require('ModelName.php');
To load a Model in CodeIgniter, you use the $this->load->model('ModelName'); syntax. This makes the Model available for use within the Controller.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *