2022-03-22 14:58:23 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Core\Form\Type;
|
|
|
|
|
2022-03-25 11:49:38 +01:00
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
2022-03-22 14:58:23 +01:00
|
|
|
use Symfony\Component\Form\FormInterface;
|
|
|
|
use Symfony\Component\Form\FormView;
|
|
|
|
|
|
|
|
class EditorJsTextareaType extends TextareaType
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function buildView(FormView $view, FormInterface $form, array $options)
|
|
|
|
{
|
|
|
|
if (!isset($view->vars['attr']['data-editorjs'])) {
|
|
|
|
$view->vars['attr']['data-editorjs'] = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
return parent::buildView($view, $form, $options);
|
|
|
|
}
|
|
|
|
}
|