One of the most common tasks developers have to do over and over is form handling. Luckily, Symfony handles this with a Form component so robust that it can live outside Symfony and be incorporated into other frameworks. Take a look into the Form component to handle data rendering and submission.
- [Narrator] To handle the request,…we simply add the following line of code.…Scroll a little bit.…Form, handleRequest,…and we have to pass the request object.…Once we handle the request, we can now ask the form…if we are sending data or not.…We'll do that with an if statement,…and inside the if statement we'll add form isSubmitted.…Let's also add the client's title,…so we don't run into any errors.…
So to the form that is being processed,…we'll just add, and we'll add title.…Now, let's move the client data to the initial form.…We have the client data.…We'll just movie this inside,…cutting, pasting inside the initial form.…This is when the form is not being sent.…Now let's add the submitted data to the form.…We'll do so by doing form data,…we get the form object, and we use the method getData.…
let's also add an empty form so we can populate it.…And now, let's add to the form,…the data that we are processing.…Form, data.…Remember this data variable is being sent to the view.…With the getData method,…we are expecting the data being sent though the arrays,…
- Installing Symfony
- Setting up the local environment
- Exploring the Symfony file structure
- Creating routes
- Sending parameters to a controller
- Using views
- Updating routes
- Creating templates with Twig
- Data modeling with Symfony
- Demo application deployment
Skill Level Intermediate
PHP: Clean URLs on Apache Serverwith David Powers1h 36m Intermediate
PHP: Managing Persistent Sessionswith David Powers2h 41m Intermediate
1. Get Started with Symfony
Install Symfony1m 33s
2. Controllers in Symfony
3. Views in Symfony
4. Data Modeling with Symfony
5. Taking Symfony Further
- 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.