News Feed
Sections




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

PHPWomen.org:
Add values to a symfony form in between save() and serialization to the database
October 05, 2012 @ 08:55:12

Kim Rowan has recently posted this helpful hint to the PHPWomen.org site concerning the addition of values between save/serialization in Symfony (1.4) forms.

OK, I have a Comment model and I want to relate Comment objects to several other different model types. So, I need to be able to persist Comment objects in my database that relate to the author of the comment and one of a handful of other tables, for example, a blog post or a licence record, etc.

She includes the contents of her "schema.yml" definition and the code to create and display a basic form. Inside of her "executeCreate", the form's submission is handled and a "processForm" method is called and the overridden "updateObject " is used to inject the new data (a user ID) into the submission.

0 comments voice your opinion now!
symfony form tutorial override save object inject data


blog comments powered by Disqus

Similar Posts

Jani Hartikainen's Blog: Zend_Acl part 1: Misconceptions and simple ACLs

International PHP Magazine: IPM Poll Question: Which is your Favorite CMS written in PHP?

Dave Dash's Blog: symfony + mod_rewrite: moving smoothly from development to production environments

PHPBuilder.com: PEAR's HTML_QuickForm

SpinDrop.us: Using Zend Search Lucene in a symfony app


Community Events





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


experience introduction podcast interview release laravel opinion framework language threedevsandamaybe series install code api developer testing symfony2 community unittest list

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