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.
Loading...
Related Quiz
- When a CodeIgniter application's performance degrades, the primary debugging approach should focus on ______.
- What is the primary purpose of error handling in CodeIgniter?
- To add a custom string to a Query Builder statement without escaping, use the ________ method.
- In CodeIgniter, which method of the Query Builder is commonly used to select data from a database?
- In CodeIgniter, how can you extend the session timeout for a user?