Our application logic should live inside our models and not on our controllers. Let's create and load a model and see how it interacts with the controller.
- [Instructor] CodeIgniter gives the programmer…certain liberties when it comes to models.…Models should hold a business logic of an application.…What do I mean by the business logic?…Well let me try to elaborate with an example.…Let's say our application holds properties.…And the client wants one and only one property…to be highlighted on the landing page.…It is the model's job to enforce this rule.…So whenever someone tries to highlight…a second property, the model should have a rule…preventing this from happening.…Generally, the model's also bridged to a data container.…
So most applications use models to connect…to the database.…However, this is not always true.…For now, let's stick to databases.…We're gonna go ahead and open up our files,…Desktop, Exercise Files>Ch01>01_04_start.…And I'm gonna go ahead and start the Web Server.…Ce Desktop/ExerciseFiles/Ch01/01_04_start/…And we're gonna type php -S localhost:8080.…
So let's create our first model.…So let's open up Application, Models,…and we already have a class there.…
- Loading views and data from containers
- Routing with controllers
- Creating models
- Configuring the data
- Working with data, forms, sessions, and headers
- Logging and error logging
- Extending CodeIgniter to consume dependencies
Skill Level Beginner
PHP: Managing Persistent Sessionswith David Powers2h 41m Intermediate
PHP: Clean URLs on Apache Serverwith David Powers1h 36m Intermediate
1. Get Started with CodeIgniter
2. Work with Data, Logs, Forms, and Headers
3. Take CodeIgniter Further
CodeIgniter and Composer3m 13s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.