nicolassing/quill-bundle

A Symfony bundle that integrates Quill as a drop-in replacement for textarea Symfony form.

Installs: 10 139

Dependents: 0

Suggesters: 0

Security: 0

Stars: 9

Watchers: 3

Forks: 6

Open Issues: 0

Type:symfony-bundle

v1.3 2022-12-28 09:53 UTC

This package is auto-updated.

Last update: 2024-03-28 12:38:38 UTC


README

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