tp/redactor-bundle

Redactor Form Type

Installs: 11 393

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 2

Forks: 8

Open Issues: 1

Language:JavaScript

Type:symfony-bundle

v1.0.0 2012-11-08 18:43 UTC

This package is not auto-updated.

Last update: 2023-05-20 20:51:29 UTC


README

Build Status

Installation

contributors: Bartłomiej Noszka bnlab

To instal this bundle, copy and paste to your composer.json

"friendsofsymfony/jsrouting-bundle": "dev-master",
"tp/redactor-bundle": "dev-master",

Rember to configure JsRoutingBundle guiding their README file.

Usage

in config.yml:

twig:
    form:
        resources:
            - 'TPRedactorBundle:Form:redactor_widget.html.twig'

in routing.yml:

tp_redactor:
    resource: "@TPRedactorBundle/Controller/"
    type:     annotation

add CSS and Javascript to your assetic:

  • CSS: '@TPRedactorBundle/Resources/public/css/redactor.css'
  • Javascripts: '@TPRedactorBundle/Resources/public/js/redactor.js' and '@TPRedactorBundle/Resources/public/js/tp_redactor.js'

Configuration

RedactorBundle allows you to configure the RedactorJS editor. Options are managed by "config_sets".

in config.yml

tp_redactor:
   default_config_set: default
   config_sets:
       default:
           lang: fr
       basic:
           lang: fr
           formattingTags:
               - 'h2'
               - 'h3'
               - 'p'
               - 'blockquote'

Chose your config set at form building :

    $builder->add('your_form_field', 'redactor', array('config_set' => 'basic'));

All supported redactor options can be found Here