Skip to content
Provides a Trumbowyg integration for your Symfony2 project
JavaScript CSS PHP HTML
Branch: master
Clone or download
alexdw Merge pull request #5 from emulienfou/master
 Update Trumbowyg JS library/sources from *2.1.0* to *2.10.0*
Latest commit 660aa38 Jun 2, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
DependencyInjection
Form/Type Minor fix Jul 7, 2016
Resources Add missing `en.min.js` Jul 28, 2018
Twig Remove unused class Nov 25, 2016
.DS_Store
AlexdwTrumbowygBundle.php innitial commit Jul 6, 2016
README.md
composer.json Update requirements for Symfony 2.8 to 4.0 Apr 25, 2018

README.md

TrumbowygBundle

This bundle provide an easy integration for Trumbowyg Editor in your Symfony Project.

SensioLabsInsight

Installation

 php composer.phar require alexdw/trumbowyg-bundle="0.9"

Add trumbowygbundle to your application kernel.

// app/AppKernel.php
<?php
    // ...
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Alexdw\TrumbowygBundle\AlexdwTrumbowygBundle(),
        );
    }

Install bundle assets

$ php app/console assets:install web/

Include in template

This bundle comes with an extension for Twig to makes it very easy to include the assets in your pages.

Include javascripts

    {{ trumbowyg_js() }}

You can also override the default configuration by passing an option like this:

    {{ trumbowyg_js({'include_jquery': false}) }}

Include stylesheets

    {{ trumbowyg_css() }}

Usage

// 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,
            //...
));

Default configuration

    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

You can’t perform that action at this time.