cl4u /epic-editor-bundle
此软件包已被废弃,不再维护。未建议替代软件包。
在 Symfony 2 表单中使用 EpicEditor
dev-master / 1.0.x-dev
2017-03-30 09:50 UTC
Requires
- php: >=5.3.0
- symfony/form: >=2.1
- symfony/framework-bundle: >=2.1
Requires (Dev)
- phpunit/phpunit: ~3.7
- twig/twig: 1.*
This package is not auto-updated.
Last update: 2023-10-11 07:11:18 UTC
README
将 EpicEditor 集成到您的 Symfony 2 表单中
安装
在您的 composer.json 文件中要求库
{ "require": { "cl4u/epic-editor-bundle" : "~1.0" } }
在您的 app/AppKernel.php 中注册 Bundle
new Cl4u\Bundle\EpicEditorBundle\Cl4uEpicEditorBundle(),
用法
包含 JavaScript 库
在您的 head 块中包含 JS
{{ epic_editor_javascript() }}
使用 Epic Editor 表单类型
简单地在您的 FormBuilder 上调用
$builder->add('field', 'epic_editor', array('options' = array()))
使用 EpicEditor 的不同版本
此软件包包含 EpicEditor v0.2.2。您可以通过设置参数来替换自己的版本
cl4u_epic_editor: js_path: 'bundles/cl4uepiceditor/js/epiceditor.min.js'
配置选项
以下参数值可以配置选项的完整列表
cl4u_epic_editor: js_path: 'bundles/cl4uepiceditor/js/epiceditor.min.js' options: base_path: 'bundles/cl4uepiceditor/css' client_side_storage: false local_storage_name: epic_editor use_native_fullscreen: false parser: marked focus_on_load: false file: name: ~ default_content: ~ auto_save: 100 theme: base: '/themes/base/epiceditor.css' editor: '/themes/editor/epic-dark.css' preview: '/themes/preview/github.css' button: preview: true fullscreen: true bar: true shortcut: modifier: 18 fullscreen: 80 preview: 70 string: toggle_preview: 'Toggle Preview Mode' toggle_edit: 'Toggle Edit Mode' toggle_fullscreen: 'Enter Fullscreen' autogrow: min_height: 200 max_height: 200 scroll: true