Viewers: in countries Watching now:
Speed up your development with CodeIgniter, a fast and powerful PHP web application framework. Author Jon Peck shows how to build a magazine cataloging system while describing how to use a MVC (Model-View-Controller) framework like CodeIgniter.
Starting with the what and why of CodeIgniter, Jon introduces key concepts such as the MVC pattern and libraries by demonstrating how to create static pages, then storing and displaying magazine info in a database. Advanced topics like classes and helpers are explored to validate user input, upload files, and much more. By creating a complete system, you'll have the foundation to build your own applications with CodeIgniter.
In the previous chapter, I discussed how CodeIgniter loosely implements the Model-View-Controller pattern, then demonstrated both a View and a Controller. The final component, the model, traditionally contains application data, logic and business rules, and functions. Codelgniter defines models as PHP classes that work with information in a database, which is pretty vague. Out of the box, they're treated just as a collection of properties, which I mentioned previously, is similar to a domain object. These properties are named exactly the same as the database columns with a one to one relationship. Codelgniter models contain no other stand-alone functionality by default. Traditionally, the model is a class where common functionality can be defined, including Create, where something like a time stamp or other default values can be set.
Read, where a record is retrieved from the database and used to populate the model. Update, where a record in the database is saved, and Destroy where the record and the database is deleted. Create, Read, Update, Destroy is a common collection of functionality referred to by the acronym CRUD. In this chapter, I'm going to extend the Codelgniter model to define the database table and primary key that's associated with it. Then, I'll integrate Codelgniter's database functionality with CRUD methods to allow models to save themselves similar to tradition MVC.
With this context, I'm going to create models that will allow me to represent back issues of a magazine.
There are currently no FAQs about Up and Running with PHP CodeIgniter.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.