Skip to content

Commit

Permalink
Added homeFolder parameter to ElFinderType
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszWilk committed Feb 20, 2015
1 parent db854c0 commit bd75700
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Form/Type/ElFinderType.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)

if($builder->getAttribute('enable'))
$builder->setAttribute('instance', $options['instance']);
$builder->setAttribute('homeFolder', $options['homeFolder']);
}

/**
Expand All @@ -35,6 +36,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)

if($form->getConfig()->getAttribute('enable')) {
$view->vars['instance'] = $form->getConfig()->getAttribute('instance');
$view->vars['homeFolder'] = $form->getConfig()->getAttribute('homeFolder');
}
}

Expand All @@ -45,12 +47,14 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver
->setDefaults(array(
'enable' => true,
'instance' => ''
'enable' => true,
'instance' => '',
'homeFolder' => '',
))
->addAllowedTypes(array(
'enable' => 'bool',
'instance' => array('string', 'null')
'enable' => 'bool',
'instance' => array('string', 'null'),
'homeFolder' => array('string', 'null'),
));
}
/**
Expand Down

0 comments on commit bd75700

Please sign in to comment.