Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
71 lines (62 sloc) 1.48 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 Clastic\BackofficeBundle\Form\DataTransformer\SanitizerTransformer;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* MultiSelectType.
*
* @author Dries De Peuter <dries@nousefreak.be>
*/
class WysiwygType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefaults(array(
'attr' => array(
'class' => 'wysiwyg',
),
));
}
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->addViewTransformer(new SanitizerTransformer());
}
/**
* {@inheritdoc}
*/
public function getParent()
{
return TextareaType::class;
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'wysiwyg';
}
/**
* {@inheritdoc}
*/
public function getName()
{
return $this->getBlockPrefix();
}
}