Join Jon Peck for an in-depth discussion in this video Saving magazines using active records, part of Learning PHP CodeIgniter (2013).
One of the convenient and time saving features of CodeIgniter is a loose…implementation of the active record design pattern.…When I use CodeIgniter's active records, I don't need to create classes to connect to…each database table, but I should create a model for each database table.…And I can use active records to make the models perform database operations.…This system is database agnostic, meaning all the query syntax is generated automatically.…I can access CodeIgniter's database using $this->db followed by commands such as…insert Update and delete. Rather than explicitly breaking down each…command, I will demonstrate by example, by updating the models to allow them to be persistent.…
I am also going to extend the bare minimum of native CodeIgniter model class to be…more functional by adding generic CRUD functionality to it.…This approach will also demonstrate how to extend the CodeIgniter functionality.…If I wanted to generically extend a CodeIgniter class, a specific naming…convention is required. Instead of ci_, use my_.…
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.
- What is CodeIgniter?
- Creating a static page controller
- Generating output with a view
- What is a model?
- Saving data with Active Records
- Creating forms
- Validating user input
- Listing records in tables
- Uploading images
- Viewing and deleting records