Skip to content
  • About
    • What is Symfony?
    • Community
    • News
    • Contributing
    • Support
  • Documentation
    • Symfony Docs
    • Symfony Book
    • Screencasts
    • Symfony Bundles
    • Symfony Cloud
    • Training
  • Services
    • Platform.sh for Symfony Best platform to deploy Symfony apps
    • SymfonyInsight Automatic quality checks for your apps
    • Symfony Certification Prove your knowledge and boost your career
    • SensioLabs Professional services to help you with Symfony
    • Blackfire Profile and monitor performance of your apps
  • Other
  • Blog
  • Download
sponsored by
  1. Home
  2. Documentation
  3. Bundles
  4. FOSCKEditorBundle
  5. Migration from IvoryCKEditorBundle to FOSCKEditorBundle

Migration from IvoryCKEditorBundle to FOSCKEditorBundle

Edit this page

Here we will explain the process of migration.

TL;DR: Check how we migrated SonataFormatterBundle

Update composer.json

1
2
composer remove egeloen/ckeditor-bundle
composer require friendsofsymfony/ckeditor-bundle

Update bundle definition

Replace:

1
2
3
4
5
6
<?php

// config/bundles.php
return [
    Ivory\CKEditorBundle\IvoryCKEditorBundle::class => ['all' => true],
];

With:

1
2
3
4
5
6
<?php

// config/bundles.php
return [
    FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
];

If you are not using Symfony Flex, then replace this in your AppKernel.

Replace:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
            // ...
        ];

        // ...
    }
}

With:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            new FOS\CKEditorBundle\FOSCKEditorBundle(),
            // ...
        ];

        // ...
    }
}

Update configuration root key

Only the root key of the configuration is changed.

Replace:

1
2
3
4
5
6
7
8
9
10
# config/packages/ivory_ck_editor.yaml

ivory_ck_editor:
    configs:
        my_config:
            toolbar: [ ["Source", "-", "Save"], "/", ["Anchor"], "/", ["Maximize"] ]
            uiColor:                "#000000"
            filebrowserUploadRoute: "my_route"
            extraPlugins:           "wordcount"
            # ...

With:

1
2
3
4
5
6
7
8
9
10
# config/packages/fos_ck_editor.yaml

fos_ck_editor:
    configs:
        my_config:
            toolbar: [ ["Source", "-", "Save"], "/", ["Anchor"], "/", ["Maximize"] ]
            uiColor:                "#000000"
            filebrowserUploadRoute: "my_route"
            extraPlugins:           "wordcount"
            # ...

If you are not using Symfony Flex, then replace the root key in app/config/config.yml.

Replace:

1
2
3
4
5
6
7
8
9
# app/config/config.yml
ivory_ck_editor:
    configs:
        my_config:
            toolbar: [ ["Source", "-", "Save"], "/", ["Anchor"], "/", ["Maximize"] ]
            uiColor:                "#000000"
            filebrowserUploadRoute: "my_route"
            extraPlugins:           "wordcount"
            # ...

With:

1
2
3
4
5
6
7
8
9
# app/config/config.yml
fos_ck_editor:
    configs:
        my_config:
            toolbar: [ ["Source", "-", "Save"], "/", ["Anchor"], "/", ["Maximize"] ]
            uiColor:                "#000000"
            filebrowserUploadRoute: "my_route"
            extraPlugins:           "wordcount"
            # ...

Update namespace

The main thing that changed is the namespace, so you will have to find all occurrences of Ivory\CKEditorBundle\* in your application and replace them with FOS\CKEditorBundle\*.

Before:

1
2
3
4
5
<?php

use Ivory\CKEditorBundle\Form\Type\CKEditorType;

$form->add('body',  CKEditorType::Class)

After:

1
2
3
4
5
<?php

use FOS\CKEditorBundle\Form\Type\CKEditorType;

$form->add('body',  CKEditorType::Class)

Update service definition

If you are fetching any of the services directly from the container you will have to find all occurrences of ivory_ck_editor.* in your application and replace them with fos_ck_editor.*.

Instead of doing:

1
$this->get('ivory_ck_editor.form.type');

You would do:

1
$this-get('fos_ck_editor.form.type');

Regenerate assets

First fetch ckeditor assets:

1
bin/console ckeditor:install

and then regenerate Symfony assets:

1
bin/console assets:install
This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.
TOC
    Version
    Symfony Code Performance Profiling

    Symfony Code Performance Profiling

    Put the code quality back at the heart of your project

    Put the code quality back at the heart of your project

    Version:

    Table of Contents

    • Update composer.json
    • Update bundle definition
    • Update configuration root key
    • Update namespace
    • Update service definition
    • Regenerate assets

    Symfony footer

    Avatar of Michael Dwyer, a Symfony contributor

    Thanks Michael Dwyer (@kalifg) for being a Symfony contributor

    1 commit • 9 lines changed

    View all contributors that help us make Symfony

    Become a Symfony contributor

    Be an active part of the community and contribute ideas, code and bug fixes. Both experts and newcomers are welcome.

    Learn how to contribute

    Symfony™ is a trademark of Symfony SAS. All rights reserved.

    • What is Symfony?

      • What is Symfony?
      • Symfony at a Glance
      • Symfony Components
      • Symfony Releases
      • Security Policy
      • Logo & Screenshots
      • Trademark & Licenses
      • symfony1 Legacy
    • Learn Symfony

      • Symfony Docs
      • Symfony Book
      • Reference
      • Bundles
      • Best Practices
      • Training
      • eLearning Platform
      • Certification
    • Screencasts

      • Learn Symfony
      • Learn PHP
      • Learn JavaScript
      • Learn Drupal
      • Learn RESTful APIs
    • Community

      • Symfony Community
      • SymfonyConnect
      • Events & Meetups
      • Projects using Symfony
      • Contributors
      • Symfony Jobs
      • Backers
      • Code of Conduct
      • Downloads Stats
      • Support
    • Blog

      • All Blog Posts
      • A Week of Symfony
      • Case Studies
      • Cloud
      • Community
      • Conferences
      • Diversity
      • Living on the edge
      • Releases
      • Security Advisories
      • Symfony Insight
      • Twig
      • SensioLabs Blog
    • Services

      • SensioLabs services
      • Train developers
      • Manage your project quality
      • Improve your project performance
      • Host Symfony projects

      Powered by

    Follow Symfony