Hosted by Dailymotion. For legal issues report at the Copyright Center, report us on DMC, or use the Instant Removal tool.
Lynda. Up and Running with PHP CodeIgniter / Section 2 - 1. What is CodeIgniter and why should I use it by Mr. Mubashar
1 Views • Aug 22, 2014
Description
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.
<a class="link" rel="nofollow" target="_blank" href="http://nimls.edu.pk">With this context, I'm going to create models that will allow me to represent back issues of a magazine.</a>
Keywords & Tags
More from User
Lynda. Up and Running with PHP CodeIgniter / Section 4 -2. Creating a form to add magazines
Mubasharamin52
Lynda. Up and Running with PHP CodeIgniter / Section 3 -4. Displaying a magazine
Mubasharamin52
Lynda. Up and Running with PHP CodeIgniter /4. Adding Functionality with Libraries Section 4 -1. What are CodeIgniter libraries
Mubasharamin52
Lynda. Up and Running with PHP CodeIgniter / Section 3 - 3. Saving magazines using active records
Mubasharamin52
Lynda. Up and Running with PHP CodeIgniter / Section 3 - 2. Modeling a magazine
Mubasharamin52
Lynda. Up and Running with PHP CodeIgniter / Section 3 - 1. What is a model and how is it used
Mubasharamin52
Related Videos
Lynda. Up and Running with PHP CodeIgniter / Section 2 - 3. Installing CodeIgniter
Mubasharamin52
Lynda. Up and Running with PHP CodeIgniter /4. Adding Functionality with Libraries Section 4 -1. What are CodeIgniter libraries
Mubasharamin52
Lynda. Up and Running with PHP CodeIgniter / Section 3 - 2. Modeling a magazine
Mubasharamin52
Lynda. Up and Running with PHP CodeIgniter / Section 2 - 4. Creating a static page controller
Mubasharamin52
Lynda. Up and Running with PHP CodeIgniter / Section 4 -2. Creating a form to add magazines
Mubasharamin52
Lynda. Up and Running with PHP CodeIgniter / Section 2 - 5. Generating output with a view
Mubasharamin52