News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Henrik Bjørnskov's Blog:
Symfony2 How to do a Wizard (multistep form) with Doctrine2
November 03, 2011 @ 09:13:51

Henrik Bjørnskov has a new post with a technique you can use to combine Symfony2 and Doctrine2 to create a multi-step form (a wizard) without having to worry about lost user information between steps.

The easy ways is doing it with Javascript and just show/hide the correct fieldsets when needed. The downside with this approach is that the data is only saved and validated once at the end. So if the user reloads the page the entered information is gone. The other way is to have every Step in the Wizard being a seperate form and validate the data based on what step you are on and save the necessary fields.

For his method, he created a Manager class with a StepInterface that returns the correct field names, forms and template information to render. The interface code is included in the post as well as an example of it in use setting up the wizard object, making a report and getting the correct step information from the wizard.

0 comments voice your opinion now!
wizard multistep form doctrine2 symfony2 framework


blog comments powered by Disqus

Similar Posts

Jared White's Blog: Willowgarden Highlight: Template Modes

Eirik Hoem's Blog: Prado Framework 3.1.2 released

Lineke Kerckhoffs-Willems' Blog: How to use the Symfony2 SonataAdminBundle

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 12)

IBM developerWorks: Understanding the Zend Framework, Part 1: The basics


Community Events





Don't see your event here?
Let us know!


list interview composer opinion tool symfony voicesoftheelephpant language introduction artisanfiles series podcast version library community laravel release framework security conference

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework