Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Validators can now be container aware and have the container set on t…

…hem as they are created, which is helpful for certain types of validators
  • Loading branch information...
commit 70c60e73e106244ba4f036b6e2a082a2a63b84b9 1 parent c500c99
@rikh42 authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  form/FormBuilder.php
View
3  form/FormBuilder.php
@@ -245,6 +245,9 @@ protected function loadFormElement($defaultName, array $element)
foreach ($value as $validator=>$options) {
$class = $this->getValidatorClass($validator);
$v = new $class($options);
+ if ($v instanceof ContainerAwareInterface) {
+ $v->setContainer($this->container);
+ }
$form->addValidator($v);
}
break;
Please sign in to comment.
Something went wrong with that request. Please try again.