I have to integrate the new CKEditor 5 instead of the old CKEditor 4 in symfony, with CKEditor 4 the form was submitted but now when I add CKEditor 5 this is not submitted I don't know why. On the create an article page I had the old CKEditor 4 and it worked like a charm, how can I make the CKEditor 5 work?
My ckeditor_widget.html.twig look like this:
{% block ckeditor_widget %}
<script src="{{ asset('bundles/fosckeditor/packages/ckeditor5-build-classic/build/ckeditor.js') }}"></script>
<textarea id="ckeditor" name="ckeditor">{{ value }}</textarea>
<script>
ClassicEditor
.create( document.querySelector( '#ckeditor' ) )
.then( editor => {
theEditor = editor;
} )
.catch( error => {
console.error( error );
} );
document.getElementById("submit").addEventListener("click", function() {
theEditor.updateSourceElement();
});
</script>
{% endblock %}
My builder of CKEditor look like this :
->add('content', CKEditorType::class, [
'label' => 'label.content',
'required' => true,
'config_name' => 'cms',
'config' => [
'filebrowserUploadHandler' => function (RouterInterface $router) use ($community) {
return $router->generate(
'app_manager_file_upload',
[
'group_id' => $community->getId(),
],
UrlGeneratorInterface::ABSOLUTE_URL
);
},
],
])
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…