English spoken conference

Symfony 5: The Fast Track

A new book to learn about developing modern Symfony 5 applications.

Support this project

Synchronize the textarea

Synchronize the textareaΒΆ

When the textarea is transformed into a CKEditor widget, the textarea value is no more populated except when the form is submitted. Then, it leads to issues when you try to serialize the form or you try to rely on the textarea value in JavaScript. To automatically synchronize the textarea value, you can do it globally in your configuration:

1
2
3
# app/config/config.yml
fos_ck_editor:
    input_sync: true

Or you can do it in your widget:

1
$builder->add('field', 'ckeditor', array('input_sync' => true));

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.