Symfony 2 bundle integrating Quill editor as a form type.
"require": {
"astina/quill-bundle":"dev-master",
}Enable the bundle in the kernel:
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Astina\Bundle\QuillBundle\AstinaQuillBundle(),
);
}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: snowNote: 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>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',
);