Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
68 lines (60 sloc) 1.39 KB
<?php
/**
* This file is part of the Clastic package.
*
* (c) Dries De Peuter <dries@nousefreak.be>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Clastic\BackofficeBundle\Form\Type;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* @author Dries De Peuter <dries@nousefreak.be>
*/
class FieldsetType extends FormType
{
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'legend' => '',
'inherit_data' => true,
));
}
/**
* {@inheritdoc}
*/
public function buildView(FormView $view, FormInterface $form, array $options)
{
if (false !== $options['legend']) {
$view->vars['legend'] = $options['legend'];
}
$view->vars['label'] = false;
}
/**
* {@inheritdoc}
*/
public function getParent()
{
return FormType::class;
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'fieldset';
}
/**
* {@inheritdoc}
*/
public function getName()
{
return $this->getBlockPrefix();
}
}