What is a model and how is it used? PHP CodeIgniter


show more What is a model and how is it used? provides you with in-depth training on Developer. Taught by Jon Peck as part of the Up and Running with PHP CodeIgniter show less
please wait ...

What is a model and how is it used?

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 a...

What is a model and how is it used?
Video duration: 1m 29s 1h 30m Intermediate

Viewers:

What is a model and how is it used? provides you with in-depth training on Developer. Taught by Jon Peck as part of the Up and Running with PHP CodeIgniter

Subject:
Developer
Software:
PHP CodeIgniter
Author:
please wait ...