Skip to content

nicolassing/NicolassingQuillBundle

Repository files navigation

NicolassingQuillBundle

Latest Stable Version License Build Status

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