2017 © Pedro Peláez
 

symfony-bundle ckeditor-bundle

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

image

meniam/ckeditor-bundle

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  • Friday, April 13, 2018
  • by meniam
  • Repository
  • 1 Watchers
  • 1 Stars
  • 105 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 59 Forks
  • 0 Open issues
  • 31 Versions
  • 5 % Grown

The README.md

Symfony2 CKEditor Bundle

Build Status, (*1)

KnpBundles Badge, (*2)

Installation

  1. Add TrsteelCkeditorBundle to your composer.json
  2. Enable the bundle
  3. Install bundle assets
  4. Configure the bundle (optional)
  5. Add the editor to a form
  6. Configure data transformers

Step 1: Add TrsteelCkeditorBundle to your composer.json

php composer.phar require Trsteel/ckeditor-bundle ~1.8

Step 2: Enable the bundle

``` php <?php // app/AppKernel.php, (*3)

public function registerBundles() { $bundles = array( // ... new Trsteel\CkeditorBundle\TrsteelCkeditorBundle(), ); }, (*4)


### Step 3: Install bundle assets ```bash $ php ./app/console assets:install web --symlink

--symlink is optional, (*5)

Step 4: Configure the bundle (optional)

For a full configuration dump use:, (*6)

$ php ./app/console config:dump-reference TrsteelCkeditorBundle

An example configuration:, (*7)

trsteel_ckeditor:
    class: Trsteel\CkeditorBundle\Form\Type\CkeditorType
    transformers: ['html_purifier']
    toolbar: ['document', 'clipboard', 'editing', '/', 'basicstyles', 'paragraph', 'links', '/', 'insert', 'styles', 'tools']
    toolbar_groups:
        document: ['Source','-','Save','-','Templates']
        clipboard: ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo']
        editing: ['Find','Replace','-','SelectAll']
        basicstyles: ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat']
        paragraph: ['NumberedList','BulletedList','-','Outdent','Indent','-','JustifyLeft', 'JustifyCenter','JustifyRight','JustifyBlock']
        links: ['Link','Unlink','Anchor']
        insert: ['Image','Flash','Table','HorizontalRule']
        styles: ['Styles','Format']
        tools: ['Maximize', 'ShowBlocks']
    ui_color: '#000000'
    startup_outline_blocks: true
    width: 800 #Integer or %
    height: 300 #Integer or %
    language: 'en-au'
    filebrowser_upload_url:
        url: relative-url.php?type=file
    filebrowser_image_browse_url:
        route: route_name
        route_parameters:
            type: image

Or even overwrite the 'document' toolbar group in your application completely., (*8)

trsteel_ckeditor:
    class: Trsteel\CkeditorBundle\Form\Type\CkeditorType
    toolbar: ['document', 'clipboard', 'editing', '/', 'basicstyles', 'paragraph', 'links', '/', 'insert', 'styles', 'tools']
    toolbar_groups:
        document: ['Source']

You can create additional toolbar groups. Just create the group and specify the items. As you can see in the above config the 'document' toolbar group has been overwritten and only shows the 'Source' icon., (*9)

Step 5: Add the editor to a form

Example form:, (*10)

<?php

$form = $this->createFormBuilder($post)
            ->add('title', 'text')
            ->add('content', 'ckeditor', array(
                'transformers'                 => array('html_purifier'),
                'toolbar'                      => array('document','basicstyles'),
                'toolbar_groups'               => array(
                    'document' => array('Source')
                ),
                'ui_color'                     => '#fff',
                'startup_outline_blocks'       => false,
                'width'                        => '100%',
                'height'                       => '320',
                'language'                     => 'en-au',
                'filebrowser_image_browse_url' => array(
                    'url' => 'relative-url.php?type=file',
                ),
                'filebrowser_image_browse_url' => array(
                    'route'            => 'route_name',
                    'route_parameters' => array(
                        'type' => 'image',
                    ),
                ),
            ))
            ->getForm()
;

Note: All parameters from config.yml can be overwritten in a form (excluding 'class')., (*11)

Step 6: Configure data transformers

Data transformers will automatically update the html content when the form is processed., (*12)

The bundle comes with a html purifier transformer thanks to https://github.com/ezyang/htmlpurifier, (*13)

If you do not want any transformers enabled you should disable them by:, (*14)

  1. Disable globally in the config:
trsteel_ckeditor:
    transformers: []
  1. Disable them on a particular form:
<?php

$form = $this->createFormBuilder($post)
            ->add('title', 'text')
            ->add('content', 'ckeditor', array(
                'transformers' => array(),
            ))
            ->getForm()
;

Next Steps

The Versions

13/04 2018

dev-master

9999999-dev

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

bundle symfony3 symfony ckeditor editor wysiwyg

13/04 2018

v1.9.1

1.9.1.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

bundle symfony3 symfony ckeditor editor wysiwyg

13/04 2018

v1.9.0

1.9.0.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

bundle symfony3 symfony ckeditor editor wysiwyg

08/11 2016

v1.8.9

1.8.9.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

bundle symfony3 symfony ckeditor editor wysiwyg

08/11 2016

v1.8.8

1.8.8.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

bundle symfony3 symfony ckeditor editor wysiwyg

14/12 2015

v1.8.7

1.8.7.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

bundle symfony3 symfony ckeditor editor wysiwyg

14/12 2015

v1.8.6

1.8.6.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

bundle symfony3 symfony ckeditor editor wysiwyg

30/09 2015

v1.8.4

1.8.4.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

28/09 2015

v1.8.3

1.8.3.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

28/08 2015

v1.8.2

1.8.2.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

16/07 2015

v1.8.1

1.8.1.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

10/07 2015

v1.8.0

1.8.0.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

02/06 2015

v1.7.0

1.7.0.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

28/04 2015

v1.6.2

1.6.2.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

01/12 2014

v1.6.1

1.6.1.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

27/11 2014

v1.6.0

1.6.0.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

30/10 2014

v1.5.1

1.5.1.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

28/07 2014

v1.5.0

1.5.0.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

04/06 2014

v1.4.6

1.4.6.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

18/03 2014

v1.4.5

1.4.5.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

12/03 2014

v1.4.4

1.4.4.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

19/02 2014

v1.4.3

1.4.3.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

12/02 2014

v1.4.2

1.4.2.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

06/02 2014

v1.4.1

1.4.1.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

11/12 2013

v1.4.0

1.4.0.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

06/12 2013

v1.3.1

1.3.1.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

23/11 2013

v1.3.0

1.3.0.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

The Development Requires

by Trent Steel

ckeditor editor wysiwyg

29/07 2013

v1.2.1

1.2.1.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

by Trent Steel

ckeditor editor wysiwyg

29/07 2013

v1.2.0

1.2.0.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

by Trent Steel

ckeditor editor wysiwyg

21/05 2013

v1.1

1.1.0.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

by Trent Steel

ckeditor editor wysiwyg

06/05 2012

v1.0

1.0.0.0

Symfony2 bundle for easy integration of the CKEditor WYSIWYG

  Sources   Download

MIT

The Requires

 

by Trent Steel

ckeditor editor wysiwyg