drymek/ckeditor-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

drymek/ckeditor-bundle

Composer 安装命令:

composer require drymek/ckeditor-bundle

包简介

Symfony2 bundle for easy integration of the CKEditor WYSIWYG (with file upload)

关键字:

README 文档

README

Symfony2 CKEditor Bundle

Build Status

Add the following lines to the deps file:

[TrsteelCkeditorBundle]
    git=http://github.com/trsteel88/TrsteelCkeditorBundle.git
    target=/bundles/Trsteel/CkeditorBundle

Update your vendors by running:

$ php ./bin/vendors

Add the Trsteel namespace to your autoloader.

<?php
// app/autoload.php

$loader->registerNamespaces(array(
    'Trsteel' => __DIR__.'/../vendor/bundles',
    // your other namespaces
));

Add the bundle to the application kernal.

<?php
// app/AppKernel.php

public function registerBundles()
{
    return array(
        // ...
        new Trsteel\CkeditorBundle\TrsteelCkeditorBundle(),
        // ...
    );
}

Install assets.

$ php ./app/console assets:install web --symlink

Configure the default settings for the app. This step is not required for the bundle to function.

trsteel_ckeditor:
    class: Trsteel\CkeditorBundle\Form\CkeditorType
    toolbar: ['document', 'clipboard', 'editing', '/', 'basicstyles', 'paragraph', 'links', '/', 'insert', 'styles', 'tools']
    toolbar_groups:
        document: ['Source','-','Save','-','Templates']
        clipboard: ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo']
        editing: ['Find','Replace','-','SelectAll']
        basicstyles: ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat']
        paragraph: ['NumberedList','BulletedList','-','Outdent','Indent','-','JustifyLeft', 'JustifyCenter','JustifyRight','JustifyBlock']
        links: ['Link','Unlink','Anchor']
        insert: ['Image','Flash','Table','HorizontalRule']
        styles: ['Styles','Format']
        tools: ['Maximize', 'ShowBlocks']
    ui_colour: '#000000'
    startup_outline_blocks: true
    width: 800 #Integer or %
    height: 300 #Integer or %

These settings can also be configured for a specific form.

<?php

$form = $this->createFormBuilder($post)
            ->add('title', 'text')
            ->add('content', 'ckeditor', array(
                'toolbar' => array('document','basicstyles'),
                'toolbar_groups' => array(
                    'document' => array('Source')
                )
                'ui_colour' => '#fff',
                'startup_outline_blocks' => false,
                'width'    => '100%',
                'height' => '320',
            ))
            ->getForm()
;

You can create additional toolbar groups. Just create the group and specify the items. As you can see in the above form the 'document' toolbar group has been overwritten and only shows the 'Source' icon.

In your config.yml you could add an additional toolbar_group:

trsteel_ckeditor:
    toolbar: ['document_with_source_only', 'clipboard', 'editing', '/', 'basicstyles', 'paragraph', 'links']
    toolbar_groups:
        document_with_source_only: ['Source']

Or even overwrite the 'document' toolbar group in your application completely.

trsteel_ckeditor:
    class: Trsteel\CkeditorBundle\Form\CkeditorType
    toolbar: ['document', 'clipboard', 'editing', '/', 'basicstyles', 'paragraph', 'links', '/', 'insert', 'styles', 'tools']
    toolbar_groups:
        document: ['Source']

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 59
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-02-13