IvoryCKEditorBundle: could not load type "ckeditor" (500 internal server error)

Hello,

I want to implement the ckeditor for symfony2 and I follow the installation instructions as 1/ require in composer 2/ update composer 3/ register the bundle in AppKernel.php

my builder is this :

        $builder->add('texte','ckeditor', array(
            'config' => array(
                'toolbar' => array(
                    array(
                        'name'  => 'document',
                        'items' => array('Source', '-', 'Save', 'NewPage', 'DocProps', 'Preview', 'Print', '-', 'Templates'),
                    ),
                    '/',
                    array(
                        'name'  => 'basicstyles',
                        'items' => array('Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'),
                    ),
                ),
                'uiColor' => '#ffffff',
            )
        ));

but the result webpage is a symfony error that explain : could not load type “ckeditor”

CRITICAL - Uncaught PHP Exception Symfony\Component\Form\Exception\InvalidArgumentException: "Could not load type "ckeditor"" at C:\dev\Apache2.4.6\htdocs\MyBundle\vendor\symfony\symfony\src\Symfony\Component\Form\FormRegistry.php line 89 

Do you know what can do this ?

Thanks for your support

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

The solution for me was to replace the string typed type declaration to the class based one:

From:

$builder
            ->add('fieldName', 'ckeditor', ...

To:

use Ivory\CKEditorBundle\Form\Type\CKEditorType;

...

$builder
            ->add('fieldName', CKEditorType::class, ...

Saludos, Le comparto mi experiencia. Dentro de la clase: App\ExampleBundle\Form\MyFormType agregue: use Ivory\CKEditorBundle\Form\Type\CKEditorType;

y al llamar al type: $builder ->add('reference',CKEditorType::class, array( 'filebrowsers' => array( 'VideoBrowse', ), )) Aun no entiendo porque no carga el type “ckeditor” estoy trabajando con symfony 3.2