Codeigniter Tutorial For Beginners Step By Step Pdf Download Free haidsar
The Controller The Controller is the intermediary between the model and the view. It takes the data and formats it as input to the view, where it is displayed on the screen. The Controller will be a file in the `application/controllers` folder. In this tutorial, the file will be named `user_controller.php`. The controller needs to do four things: - Create the model and view to display the content. - Retrieve the data from the database. - Display the information. - Respond to user interaction (user clicks on links, etc). Let's see the controller for a moment. In the above snippet, we are working with two variables. `$data` and `$user` are all that is left of the data retrieved from the database.