Skip to content

Commit

Permalink
Allows options to be a callable
Browse files Browse the repository at this point in the history
  • Loading branch information
rande committed Jul 29, 2013
1 parent e5fac1b commit 1db83d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Form/Type/ImmutableArrayType.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$builder->add($infos);
} else {
list($name, $type, $options) = $infos;

if (is_callable($options)) {
$options = $options($builder, $options);
}

$builder->add($name, $type, $options);
}
}
Expand Down

0 comments on commit 1db83d7

Please sign in to comment.