FMSummernoteBundle integrates the Summernote WYSIWYG editor with Symfony applications.
- PHP 8.0 or higher
- Symfony 6.0 or higher
- jQuery (can be included automatically)
composer require helios-ag/fm-summernote-bundleIf you're using Symfony Flex, the bundle will be enabled automatically. Otherwise, enable it in your config/bundles.php file:
// config/bundles.php
return [
// ...
FM\SummernoteBundle\FMSummernoteBundle::class => ['all' => true],
];You can configure the bundle as follows, but note that the plugins "elfinder" and "video" are not supported in Jquery2.x.
fm_summernote:
plugins:
- video
- elfinder # by default plugins not set, bundle comes with elfinder plugin / provides integration with FMElfinderBundle
selector: .summernote #defines summernote selector for apply to
toolbar: # define toolbars, if no toolbar configured, default toolbars defined
style: [style]
bold: [bold]
extra_toolbar: # extra toolbar can be used for plugins toolbar and as additional toolbar setings, when 'toolbar' option is omitted
elfinder: [elfinder]
width: 600
height: 400
language: '' # define language (with language culture code like de-DE, fr-FR, etc.) by default, it is in english
include_jquery: true #include js libraries, if your template already have them, set to false
include_bootstrap: true
include_fontawesome: trueTwig template example
{{ summernote_init() }}
<textarea class="summernote"></textarea>