So I'm trying to integrate tinymce for my textareas but I keep getting JS errors, asked chatgpt and all but no solution.
I did as the tinymce doc said (https://www.tiny.cloud/docs/tinymce/latest/php-projects/), copied the directory to my public js folder, initialized it in my twig javascript block, added the class selector to my textareas but nothing will make it work.
Here's my code :
base.html.twig
{% block javascripts %}
{% block importmap %}{{ importmap('app') }}{% endblock %}
<script src="{{ asset('js\tinymce\tinymce.min.js')}}" referrerpolicy="origin"></script>
<script>
tinymce.init({
selector: '.tinymce'
});
</script>
<script src="{{ asset('js/script.js')}}"></script>
{% endblock %}
Form
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('contenu', TextareaType::class, [
'label' => 'Avis',
'attr' => [
'class' => 'tinymce form',
]
]);
}
EDIT : problem fixed, must have been an issue during the installation but I removed and re-installed tinymce and it worked just fine