Join Bernard Pineda for an in-depth discussion in this video Form update with validation, part of Learning CodeIgniter 3.
- [Narrator] We're still working on the 02_08_start files.…So now, let's add the cherry on the top to our validation.…We're working on our edit method…of our properties controller.…So now, let's go to the else clause…and instead of just getting the data from the database,…we're just gonna add an additional data.…We're gonna add the name,…and instead of being from the database,…we're gonna get it from form,…with $this->input->post('name').…Same goes for the description.…
So let's just copy and paste.…Instead of name, just change it to description.…And now let's test it on our browser.…So let's try to update a record with an empty name.…Save.…And now it's showing correctly the error.…Let's do the same with description.…And it does the same.…The last thing we need to do is to update the record…in case the validations are correct.…So let's just go to line 105.…Copy the line without the comment.…And paste it above the redirect.…
So now let's test it on our browser.…So let's change the name to New name…and New description.…
- 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: Clean URLs on Apache Serverwith David Powers1h 36m Intermediate
PHP: Managing Persistent Sessionswith David Powers2h 41m 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.