nicolassing / quill-bundle
A Symfony bundle that integrates Quill as a drop-in replacement for textarea Symfony form.
Installs: 11 258
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 3
Forks: 5
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.1.3
- ext-json: *
- symfony/form: ^4.2|^5.0|^6.0
- symfony/framework-bundle: ^4.2|^5.0|^6.0
- symfony/templating: ^4.2|^5.0|^6.0
- symfony/twig-bundle: ^4.2|^5.0|^6.0
- symfony/validator: ^4.2|^5.0|^6.0
- twig/twig: ^2.0|^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3
- phpunit/phpunit: ^9.5
- symfony/phpunit-bridge: ^4.2|^5.0|^6.0
- symfony/yaml: ^4.2|^5.0|^6.0
This package is auto-updated.
Last update: 2024-10-28 13:52:00 UTC
README
This bundle integrate quilljs in your Symfony project.
Installation
Add the nicolassing/quill-bundle
package to your require
section in the composer.json
file.
$ composer require nicolassing/quill-bundle
Usage
Configure quill
client(s) in your config/packages/nicolassing_quill.yaml
:
nicolassing_quill: theme: snow height: 10rem
There is 2 themes available
- snow (default)
- bubble
Add a quill widget into your form
namespace App\Form\Type; use Symfony\Component\Form\AbstractType; use Nicolassing\QuillBundle\Form\Type\QuillType; use Symfony\Component\Form\FormBuilderInterface; class FooType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('bar', QuillType::class) ; } }
Add javascript and stylesheet in your twig template
<!-- Include stylesheet --> <link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet"> {{ form_row(form.bar) }} <!-- Include the Quill library --> <script src="https://cdn.quilljs.com/1.3.6/quill.js"></script> <script src="bundles/nicolassingquill/js/nicolassing_quill.js"></script>
Contributing
Before submitting a Pull Request please check all tests pass
vendor/bin/php-cs-fixer fix .
vendor/bin/simple-phpunit