64x64 icon dark hosting
Choose a hosting plan here and get a free year's subscription to Tuts+ (worth $180).

Creating Reusable Forms in Symfony 2


Start a hosting plan from $3.92/mo and get a free year on Tuts+ (normally $180)

This post is part of a series called Working with Symfony 2.
Working With Templates in Symfony 2
Form Validation in Symfony 2

In this video, we'll build upon our existing knowledge of Symfony 2 to learn how to create reusable forms. We'll learn how to create a separate form class to house our form logic, build the form in a controller and then render it to the browser, from a template.

In Conclusion

Now there's lots of other options that you can pass in while creating your forms, to customize them to your liking. We'll see more of these in action as we proceed through the series. 

In the next video, we'll learn how to validate our data and process the form submission in order to prepare the data to be persisted to a database. Stay tuned for the next one! 

Thanks for watching.