FriendsOfSymfony / FOSCKEditorBundle

Provides a CKEditor integration for your Symfony project.
Other
516 stars 83 forks source link

An exception has been thrown during the rendering of a template #232

Closed tinhlesc closed 2 years ago

tinhlesc commented 2 years ago

I'm using symfony 4 and Webpack Encore. I followed this page for installation: https://symfony.com/doc/current/bundles/FOSCKEditorBundle/installation.html My config:

# config/packages/fos_ck_editor.yaml
fos_ck_editor:
  configs:
    my_config:
      toolbar: [ [ "Source", "-", "Save" ], "/", [ "Anchor" ], "/", [ "Maximize" ] ]
      uiColor: "#000000"
      filebrowserUploadRoute: "my_route"
      extraPlugins: "wordcount"
  base_path: "./build/ckeditor"
  js_path:   "./build/ckeditor/ckeditor.js"

My form type:

->add('description', CKEditorType::class, array(
                'config' => array(
                    'uiColor' => '#ffffff',
                ),
))

My configuration twig:

twig:
    ...
    form_themes:
        ...
        - '@FOSCKEditor/Form/ckeditor_widget.html.twig'

But I still get error message like this:

"An exception has been thrown during the rendering of a template ("Error of type E_NOTICE on line 80 of /var/www/tinhle/elena.voycerdev.com/vendor/twig/twig/src/Environment.php(418) : eval()'d code: Array to string conversion") in "@FOSCKEditor/Form/ckeditor_widget.html.twig"." 

Could you help me, please?

tinhlesc commented 2 years ago

I resolved my problems. :)