Model's responsibility is to handle all data logic and representation and load data in the views. It is stored in application/models folder.
The basic structure of a model file
Codelginator Models 1
Here, ModelName is the name of your model file. Remember, the class first letter must be in an uppercase letter followed by other lowercase letters, and it should be the same as your file name. It extends the base CodeIgniter Model so that all the built-in methods of parent Model file gets inherited to the newly created file.
CodeIgniter is based on the Model-View-Controller (MVC) development pattern. MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.