Join Jon Peck for an in-depth discussion in this video Introducing the Form component, part of Up and Running with Symfony2 for PHP (2014).
- One of the most common tasks in web development…is creating and using HTML forms to accept user input.…However, it's notoriously hard to make forms…quickly, securely and reusable.…Fortunately, Symfony2 comes with a Form component…which solves many of these problems…and allows developers to focus on writing…custom business logic.…We'll start our exploration with how forms are defined…and how they interact with other Symfony components…like Doctrine.…We'll take that foundation and use it to analyze…and extend the forms generated in the previous chapter.…
Of course, no form would be complete…without the ability to validate user input.…At the end, we'll even upload files,…like cover images for magazines.…So, what is the Symfony2 Form component?…Well, as you can probably imagine,…it's a component that provides comprehensive tools…for defining and using HTML forms.…Like other Symfony components,…the Form component is a standalone library…that can be used independently of Symfony.…But, at the same time, it makes a lot of sense…
- Installing Symfony
- Creating a bundle from the console
- Customizing and generating database tables
- Generating controllers
- Creating, editing, and debugging entities
- Displaying and debugging a form
- Rendering content with templates
Skill Level Intermediate
Q: When trying to access the application, I receive an error stating "This script is only accessible from localhost." How can I get around this restriction?
A: The development front controller and configuration scripts are protected by default to only allow access from the localhost. Refer to the video titled “Exploring the Symfony layout” to see how to disable this security.