Tutorial 4- Model

Model is a Class which is called by Controller, do database Query  and return result to Controller.

  • Model Files located at application/models folder
  • That File contains a Class same named as the file excluding file extension(.php).
  • The name of the Model class and the file must start with an uppercase letter.
  • The class should extend core Model name CI_Model
  • Model should be load from controller calling $this->load->model('model_name'); Or we can configure autolad.php to load automatic

How to create and use model we can learn it from CI Documentaion

We can  learn how to  use Query builder inside model from here

Details use of database is here

Bookmark the permalink.

Leave a Reply

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