Skip to content
Browse files

added $options field and get() set() methods for it

  • Loading branch information...
1 parent 39e5782 commit 47b88cbac66a46970ca1ad008614ee61c4468703 @redexp redexp committed
Showing with 15 additions and 3 deletions.
  1. +15 −3 Resources/skeleton/FormType.php
View
18 Resources/skeleton/FormType.php
@@ -8,6 +8,20 @@
class ##CLASS## extends AbstractType
{
+ private $options = array(
+ 'data_class' => '##FQCN##',
+ );
+
+ public function set($name, $value)
+ {
+ $this->options[$name] = $value;
+ }
+
+ public function get($name)
+ {
+ return $this->options[$name];
+ }
+
/**
* {@inheritdoc}
*/
@@ -20,9 +34,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
- $resolver->setDefaults(array(
- 'data_class' => '##FQCN##',
- ));
+ $resolver->setDefaults($this->options);
}
/**

0 comments on commit 47b88cb

Please sign in to comment.
Something went wrong with that request. Please try again.