I'm getting the following error on Symfony2:
Warning: array_replace() [function.array-replace]: Argument #1 is not an array in /home/rackelas/public_html/dev/Symfony/vendor/symfony/src/Symfony/Component/Form/FormFactory.php line 236
after adding the following to Acme/Bundle/Form/Type/ContactType.php for validation:
public function getDefaultOptions(array $options)
{
$collectionConstraint = new Collection(array(
'name' => new MinLength(5),
'email' => new Email(array('message' => 'Invalid email address')),
));
$options['validation_constraint'] = $collectionConstraint;
}
source: http://symfony.com/doc/current/book/forms.html#using-a-form-without-a-class
Any help in the right direction would be appreciated.