<?php
namespace App\Form\Type;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
class HTMLType extends TextType
{
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefined('template');
$resolver->setDefaults([
'mapped' => false,
'template' => null,
'object' => null,
'align' => null,
'disabled' => false
]);
}
public function buildView(FormView $view, FormInterface $form, array $options)
{
parent::buildView($view, $form, $options);
$view->vars['template'] = $options['template'];
$view->vars['object'] = $options['object'];
$view->vars['align'] = $options['align'];
$view->vars['disabled'] = $options['disabled'];
}
/**
* {@inheritdoc}
*/
public function getName()
{
return $this->getBlockPrefix();
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'html';
}
}