diff --git a/Form/Type/ElFinderType.php b/Form/Type/ElFinderType.php index e08fc3c..77ef2fc 100644 --- a/Form/Type/ElFinderType.php +++ b/Form/Type/ElFinderType.php @@ -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']); } /** @@ -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'); } } @@ -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'), )); } /**