This bundle provide an easy integration for Trumbowyg Editor in your Symfony Project.
php composer.phar require alexdw/trumbowyg-bundle="0.9"
// app/AppKernel.php
<?php
// ...
public function registerBundles()
{
$bundles = array(
// ...
new Alexdw\TrumbowygBundle\AlexdwTrumbowygBundle(),
);
}
$ php app/console assets:install web/
This bundle comes with an extension for Twig to makes it very easy to include the assets in your pages.
{{ trumbowyg_js() }}
You can also override the default configuration by passing an option like this:
{{ trumbowyg_js({'include_jquery': false}) }}
{{ trumbowyg_css() }}
// Symfony 2.7 and previous versions
$builder->add('field', 'trumbowyg', array(
'reset_css' => true,
//...
));
// Symfony 2.8 and newer versions
use Alexdw\TrumbowygBundle\Form\Type\TrumbowygType;
$builder->add('field', TrumbowygType::class, array(
'reset_css' => true,
//...
));
alexdw_trumbowyg:
base_path: /bundles/alexdwtrumbowyg/
svg_path: /bundles/alexdwtrumbowyg/ui/icons.svg
language: en
autogrow: false
reset_css: false
semantic: false
remove_format_pasted: false
include_jquery: true
jquery_path: /bundles/alexdwtrumbowyg/vendor/jquery-3.2.1.min.js
btns:
- ["viewHTML"]
- ["formatting"]
- "btnGrp-semantic"
- ["superscript","subscript"]
- ["link"]
- ["insertImage"]
- "btnGrp-justify"
- "btnGrp-lists"
- ["horizontalRule"]
- ["removeformat"]
- ["fullscreen"]
All parameters explained here