astina/quill-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Symfony 2 bundle integrating Quill editor as a form type.

Installs: 575

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 2

Open Issues: 0

Language:JavaScript

Type:symfony-bundle

dev-master 2017-08-30 13:47 UTC

This package is not auto-updated.

Last update: 2018-01-26 15:23:23 UTC


README

Symfony 2 bundle integrating Quill editor as a form type.

http://quilljs.com/

Installation

Step 1: Add to composer.json

"require":  {
    "astina/quill-bundle":"dev-master",
}

Step 2: Enable the bundle

Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Astina\Bundle\QuillBundle\AstinaQuillBundle(),
    );
}

Step 3: Configure the bundle

Change the default config values if needed:

# app/config/config.yml
astina_quill:
    quill_url:            bundles/astinaquill/js/quill.min.js
    toolbar_template:     'AstinaQuillBundle:Editor:toolbar.html.twig'
    theme:                snow

Note: Make sure that the proper theme css file is loaded in the page where you want to use the editor.

<head>
    <link rel="stylesheet" href="{{ asset('bundles/astinaquill/css/themes/quill.snow.css') }}" />
</head>

Usage

The bundle adds a form type named "quill" to be used in your form class:

public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder->add('content', 'quill');
}

All bundle config options can also be used for individual fields:

$builder->add('content', 'quill', array(
    'toolbar_template': 'AcmeFooBundle::toolbar_template.html.twig',
);