FMElfinderBundle和ckeditor集成

时间:2016-02-19 10:54:29

标签: javascript php symfony ckeditor

我尝试为FMElfinderBundle安装ckeditor

https://github.com/helios-ag/FMElfinderBundle/blob/master/Resources/doc/ckeditor-integration.md

composer.json

"helios-ag/fm-elfinder-bundle": "~6",
 "egeloen/ckeditor-bundle": "^4.0",

config.yml

ivory_ck_editor:
    default_config: default
    configs:
        default:
            filebrowserBrowseRoute: elfinder
            filebrowserBrowseRouteParameters: []



fm_elfinder:
    instances:
        default:
            locale: %locale% # defaults to current request locale
#            editor: tinymce
#            tinymce_popup_path: "asset[bundles/stfalcontinymce/vendor/tiny_mce/tiny_mce_popup.js]"
            editor: ckeditor # other options are ckeditor tinymce, tinymce4, fm_tinymce,  form, simple, custom
            #editor_template: set custom template for your editor # default null
            #path_prefix: / # for setting custom assets path prefix, useful for non vhost configurations, i.e. http://127.0.0.1/mysite/
            #fullscreen: true|false # defaults true, applies to simple and ckeditor editors
            #theme: smoothness # jquery theme, default is 'smoothness'
            include_assets: true # disable if you want to handle loading of the javascript and css assets yourself
            #visible_mime_types: ['image/png', 'image/jpg', 'image/jpeg'] # only show these mime types, defaults to show all
            connector:
                #debug: true|false # defaults to false
                roots:       # at least one root must be defined
                    pages:
                        #show_hidden: true|false # defaults to false, hide files that
                        driver: LocalFileSystem
                        path: ../app/Resources/views/page
                        upload_allow: ['image/png', 'image/jpg', 'image/jpeg']
                        upload_deny: ['all']
                        upload_max_size: 2M

然后打开app_dev.php / elfinder

我有页面和文件 - 但编辑是在textarea而不是ckeditor如何将htm.twig文件连接到ckeditor? (我试着.html同样 - textarea)

我不明白doc:

Note that instance name should be the same as configured in elfinder bundle

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

我应该把这段代码放在哪里?

0 个答案:

没有答案