nmb/tinymce-bundle

Integrate TinyMCE 4.x editor into symfony2

Installs: 59

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 1

Open Issues: 1

Type:symfony-bundle

dev-master 2013-10-26 20:54 UTC

This package is not auto-updated.

Last update: 2024-05-06 13:00:10 UTC


README

Integrate TinyMCE 4.x editor into symfony2

Installation

Add NmbTinymceBundle to your composer.json

{
    "require": {
        "nmb/tinymce-bundle": "dev-master"
    }
}

Download the bundle by runung the command

$php composer.phar update nmb/tinymce-bundle

Add the bundle to your app/AppKernel.php

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Nmb\TinymceBundle\NmbTinymceBundle(),
    );
}

Configuration

You can add as many configurations as you want under nmb_tinymce key, name it as you want, and choose witch one you want to use on every tinymce instance. refer to tinymce documentation for the configuration itself: http://www.tinymce.com/wiki.php/Installation

# app/config/config.yml
nmb_tinymce:
    configs:
        my_basic_config:
            selector: textarea
        advanced_config:
            selector: "textarea#elm1"
            theme: "modern"
            width: 300
            height: 300
            plugins: ["advlist autolink link image lists","searchreplace wordcount visualblocks code","save table contextmenu directionality textcolor"]
            content_css: "css/content.css"
            toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l      ink image | print preview media fullpage | forecolor backcolor emoticons"
            style_formats: [ [title: 'Bold text', inline: 'b'], [title: 'exmample 2', inline: 'span', styles: [color: '#fff000']] ]      
        other_config:
            ...

Usage

In your twig template

{{ nmb_tinymce_init('my_config_key') }}