Reputation: 85486
To set a value in a form programmatically with Symfony2, after a form has been created, I've found that the following way works:
$form_data = $form->getData();
$form_data['name'] = 'new value';
$form->setData($form_data);
This is awkward, isn't there a simpler way like $form->set('name', 'new value');
?
Upvotes: 1
Views: 755