creative / quilljs-bundle
Symfony bundle for form type with Quill WYSIWYG
1.0.4
2021-01-27 04:22 UTC
Requires
- php: >=7.4.5
- ext-ctype: *
- symfony/asset: ^5.0
- symfony/config: ^5.0
- symfony/dependency-injection: ^5.0
- symfony/form: ^5.0
- symfony/http-kernel: ^5.0
- symfony/twig-bundle: ^5.0
- symfony/yaml: ^5.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- matthiasnoback/symfony-dependency-injection-test: ^4.1
- phpunit/phpunit: ^9.1
- symfony/phpunit-bridge: ^5.0
- symfony/var-dumper: ^5.0
- vimeo/psalm: ^3.11
README
QuillJS is a modern and powerful rich text editor. This bundle allows you to use this editor in Symfony form textarea field.
Installation
Symfony flex
coming soon
Direct way
- install package
composer require creative/quilljs-bundle
- add a bundle to you
config/bundles.php
:return [ // another bundles CreativeQuillJs\QuillJsBundle::class => ['all' => true], ];
- place a configuration file (see below) to you
config/packages
Configuration reference
creative_quill_js: enabled: true theme: ~ # remove this string to use default 'snow' theme quill_js_source: ~ # remove this string to use js from CDN (https://cdn.quilljs.com/1.3.6/quill.js) quill_css_source: ~ # remove this string to use css from CDN (https://cdn.quilljs.com/1.3.6/quill.snow.css) upload_route: ~ # if you have override Quill to upload files (I mean, to not place images as base64 to text), set your route to upload files here. You can set the application route name or absolute url to this parameter (if you using CDN for images) upload_route_parameters: type: 'image' # any parameters to upload route toolbar_options: # QuillJS toolbar configuration (https://quilljs.com/docs/modules/toolbar/) - ['bold', 'italic', 'underline', 'strike'] - ['blockquote', 'code-block'] - [{'header': [2, 3, false]}] - [{'list': 'ordered'}, {'list': 'bullet'}] - [{'script': 'sub'}, {'script': 'super'}] - [{'indent': '-1'}, {'indent': '+1'}] - [{'direction': 'rtl'}] - [{'size': ['small', false, 'large', 'huge']}] - ['link', 'image', 'video'] - ['clean'] - [{'color': [], 'background': []}] - [{'font': []}] - [{'align': []}]
Attention
If you want to use your own QuillJS instance (and source of it already loaded to page), set config parameters quill_js_source
and quill_css_source
to null
. The template calls const quill = new Quill
in JS block, and if quill_js_source
and quill_css_source
are nulls, it not tries to load assets with css/js.
Contributing
Feel free to use this code, modify it, give it, sale it and do with it whatever you want.
Testing
composer install vendor/bin/phpunit