How to pass request data to symfony form

Use option during sfForm construction.

for example in your action:

$form = new myForm(null, 
                   array('attributeFoo' => 
                         $this->getUser()->getAttribute('attributeFoo'));

and then retrieve the value inside the form class:

$this->getOption(‘attributeFoo’);

More information here : http://stackoverflow.com/questions/627585/how-to-get-user-data-in-form-in-symfony-1-2#2920785

Leave a Reply

Your email address will not be published. Required fields are marked *