Skip to content

Commit

Permalink
added $options field and get() set() methods for it
Browse files Browse the repository at this point in the history
  • Loading branch information
redexp committed Nov 8, 2012
1 parent 39e5782 commit 47b88cb
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Resources/skeleton/FormType.php
Expand Up @@ -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}
*/
Expand All @@ -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);
}

/**
Expand Down

0 comments on commit 47b88cb

Please sign in to comment.