Closed
Description
Hello,
I think i found a problem in Symfony Form (2.0.6).
First : http://symfony.com/doc/2.0/book/forms.html#adding-validation
In the example, there is no return $options, it was my first problem in trying to add constraints to my form. I'm not sure of the whole correction so i didn't pull-requested anything in the symfony-doc repo yet.
Second, a more serious problem (i guess it's not really a documentation issue, but still), when FormFactory process the options, it failed to array_replace the Constraints Collection :
The code
public function getDefaultOptions(array $options)
{
$collectionConstraint = new Collection(array(
'time' => new Choice(array(
'choices' => $this->times
))
));
return $options['validation_constraint'] = $collectionConstraint;
}
The error
Warning: array_replace(): Argument #1 is not an array in /path/to/my/project/vendor/symfony/src/Symfony/Component/Form/FormFactory.php line 236
Argument #1 being the Constraints Collection :
at array_replace (object(Collection), array('data' => ...
Am i doing something wrong or is the documentation out of date ?
Metadata
Metadata
Assignees
Labels
No labels