CKEditor和FMElfinder:上传图像symfony后端

时间:2017-08-24 15:41:11

标签: php symfony ckeditor

我在symfony 3下,我安装了Ivory CKEditor Bundle和FMElfinderBundle,以便从CKEditor上传图像。 Here is the page I read

我担心的是我不知道在哪里放置(在CKEditor文件中)这段代码:

// applies to Ivory CKEditor Bundle
$form = $this->createFormBuilder()->add('content', 'ckeditor', array('config' => array('filebrowserBrowseRoute' => 'elfinder','filebrowserBrowseRouteParameters' => array('instance' => 'default','homeFolder' => '') ), ),))->getForm();

1 个答案:

答案 0 :(得分:0)

文档未更新,因此您在symfony3中执行的操作是在表单类型中添加的,还要查看docs

bind_param

如果您想以所有ckeditor形式使用elfinder,只需添加配置docs

use Ivory\CKEditorBundle\Form\Type\CKEditorType;

->add('content', CKEditorType::class, array(
        'config' => array(
            'filebrowserBrowseRoute' => 'elfinder',
            'filebrowserBrowseRouteParameters' => array(
                'instance' => 'default',
                'homeFolder' => ''
            )
        ),
    ),
))