Symfony 如何使用ckeditor
首先:
1)加载以下两个bundle
"egeloen/ckeditor-bundle": "^4.0",
"helios-ag/fm-elfinder-bundle": "^6.2" 2)注册
new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
new FM\ElfinderBundle\FMElfinderBundle() 3)配置
fm_elfinder:
#assets_path: / # default is /assets, this is where css/js elfinder files are
instances:
default:
locale: "%locale%" # defaults to current request locale
editor: ckeditor # other options are tinymce, tinymce4, fm_tinymce, form, simple, custom
#editor_template: 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 # default is true, applies to simple and ckeditor editors
#theme: smoothness # jquery theme, default is 'smoothness'
include_assets: true # disable if you want to manage loading of javascript and css assets manually
#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, defines root filemanager directories
uploads:
#show_hidden: true|false # defaults to false, hides dotfiles
driver: LocalFileSystem
path: "%kernel.root_dir%/../web/attach/upload/"
upload_allow: ['image/png', 'image/jpg', 'image/jpeg']
upload_deny: ['all']
upload_max_size: 10M # also file upload sizes restricted in php.ini
url: attach/upload #这里是你服务器的目录
#attributes: example of setting attributes permission
# - { pattern: '/(.*?)/', read: true, write: false, locked: true }
4)在表单引入
->add('content',CKEditorType::class,[
'label'=>'内容',
'required'=>true,
'attr'=>[
],
'config' => array(
'filebrowserBrowseRoute' => 'elfinder',
'uiColor' => '#ffffff',
'filebrowserBrowseRouteParameters' => [
'instance' => 'default',
'homeFolder' => ''
]
)
])
5)
显示内容
<tr>
<th>内容</th>
<td>{{ post.content|raw}}</td>
</tr>
如果需要全部代码关注我微信号whenDreams回复"Symfony使用ckeditor",
或者加QQ群:182983780
我的微信
Symfony 如何使用ckeditor的更多相关文章
- 七牛云:ckeditor JS SDK 结合 C#实现多图片上传。
成功了,搞了2天.分享一下经验. 首先是把官方的那个例子下载下来,然后照如下的方式修改. 其中tempValue是一个全局变量. function savetoqiniu() { var upload ...
- 基于CkEditor实现.net在线开发之路(7)列表页面开发动作介绍
一个列表页面不止是查询,它也包含了很多业务上功能的实现,这些业务功能的实现的逻辑我称之为动作.如触发单击按钮删除数据,更改业务表数据,调用webService,调用WCF接口,弹出新窗体新增.修改.查 ...
- 个人CKeditor的config.js配置
/** * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. * For lic ...
- 基于CkEditor实现.net在线开发之路(8)Vs开发怎么配置
前段时间有一园友问我,怎么将组件放置到VS开发工具的工具箱中,用vs开发工具配合CKEditor实现在线.net开发呢? 第一步:登陆http://www.zjt-lab.com:8090/login ...
- 基于CkEditor实现.net在线开发之路(6)vs开发工具配合一起开发
上一章讲解了利用CKEditor实现了一个简单的列表功能的查询,CKEditor编辑器是由js实现的,js是一门非常强大的语法,但是要用它实现Vs开发工具那样强大编辑器的功能,估计不可能,这就使得CK ...
- 基于CkEditor实现.net在线开发之路(4)快速布局,工具箱,模板载入,tab选项卡简单说明与使用
上一章给常用的from表单控件属性页面,进行了简单说明和介绍,但是由于是在网页中做界面设计,操作肯定没有桌面应用程序方便,便捷,为了更方便的布局与设计,今天我主要说一下快速布局,工具箱,tab选项卡, ...
- 基于CkEditor实现.net在线开发之路(3)常用From表单控件介绍与说明
上一章已经简单介绍了CKEditor控件可以编写C#代码,然后可以通过ajax去调用,但是要在网页上面编写所有C#后台逻辑,肯定痛苦死了,不说实现复杂的逻辑,就算实现一个简单增删改查,都会让人头痛欲裂 ...
- 基于CkEditor实现.net在线开发之路(2)编写C#代码,怎么调用它。
上一章简约的介绍了CkEditor编辑器,可以编辑js逻辑代码,css,html,C#代码,这章我根据实际例子,讲解怎么编写C#代码和怎么调用它. 大家都还记得刚刚接触程序编时的hello Word吧 ...
- 基于CkEditor实现.net在线开发之路(1)
我以前的公司使用office sharepoint designer为界面设计器,嵌套各种自定义控件,进行各种管理软件,工作流的开发,遇到比较复杂的逻辑,则采用本地写类库,生成DLL上传到服务器,通过 ...
随机推荐
- wmi在渗透测试中的运用
Abusing WMI to Build a Persistent, Asynchronous, and Fileless Backdoor 滥用 WMI 打造一个永久.异步.无文件后门 http:/ ...
- Android学习(十六) 通过GestureDetector进行手势识别
一.手势交互过程: 1)触屏时,触发MotionEvent事件. 2)被OnTouchListener监听,在onTouch()中获得MotionEvent对象. 3)GestureDetector转 ...
- php装饰器
<?php /* * 用一个类来装饰另一个类,动态的给一个对象增加一些额外功能,这些功能一般是在这个对象调用方法前或方法后 * 比如我们要给User类增加一个登陆日志的功能 */ // 抽象构件 ...
- 在UC浏览器打开链接唤醒app,假设没有安装该app,则跳转到appstore下载该应用
在UC浏览器打开链接唤醒app,假设没有安装该app,则跳转到appstore下载该应用 须要在project中设置例如以下: 1.打开project中的myapp-Info.plist文件 2.打开 ...
- 常用的二种修改mysql最大连接数的方法
方法一:进入MYSQL安装目录 打开MYSQL配置文件 my.ini 或 my.cnf查找 max_connections=100 修改为 max_connections=1000 服务里重起MY ...
- Effective C++ Item 25 考虑写出一个不抛异常的swap函数
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie 经验:当std::swap对你的类型效率不高时,提供一个swap成员函数,并确定这个函数不抛 ...
- 为什么 Linux 的 htop 命令完胜 top 命令
在 Linux 系统中,top 命令用来显示系统中正在运行的进程的实时状态,它显示了一些非常有用的信息,比如 CPU 利用情况.内存消耗情况,以及每个进程情况等.但是,你知道吗?还有另外一个命令行工具 ...
- [[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"] 找不到对应的文件解决方法
最近在使用[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]时,找不到其对应的文件,文 ...
- dotnet 各个版本的下载链接----Download .NET SDKs for Visual Studio
https://dotnet.microsoft.com/download/visual-studio-sdks Not sure what to download? See recommended ...
- Eclipse注释模板设置
设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元 ...
我的微信