ou now know how you can read data from a database using CodeIgniter, but you haven’t written any information to the database yet. In this section, you’ll expand your news controller and model created earlier to include this functionality. Create a form To input data into the database, you need to create a form where you can input the information to be stored. This means you’ll be needing a form with two fields, one for the title and one for the text. You’ll derive the slug from our t ...
Now that the queries are written, the model should be tied to the views that are going to display the news items to the user. This could be done in our Pages controller created earlier, but for the sake of clarity, a new News controller is defined. Create the new controller at app/Controllers/News.php. ...