Skip to content

Commit

Permalink
Container: calls validate() only on IControl & Container [Closes #86]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jun 30, 2016
1 parent d260d62 commit 07051a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Forms/Container.php
Expand Up @@ -132,7 +132,9 @@ public function isValid()
public function validate(array $controls = NULL)
{
foreach ($controls === NULL ? $this->getComponents() : $controls as $control) {
$control->validate();
if ($control instanceof IControl || $control instanceof self) {
$control->validate();
}
}
if ($this->onValidate !== NULL) {
if (!is_array($this->onValidate) && !$this->onValidate instanceof \Traversable) {
Expand Down

0 comments on commit 07051a2

Please sign in to comment.