注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

勇气

终生读书

 
 
 

日志

 
 

cakephp 添加ckeditor 教程  

2015-04-15 23:47:15|  分类: AngularJs |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
来源: http://www.cakecoded.com/article/ck-editor-helper 

CK Editor Helper

JUL 12TH 2013, 22:40

There are a few CK Editor helpers available for CakePHP, but I wanted to write one that could be used as easily as the Form Helper.

So here it is!  Download this from GitHub - this works as follows:

1) Download the code from GitHub and pop the CKHelper.php file into app/View/Helper

2) Download CkEditor and place it in the folder
app/webroot/js/ckeditor

3) In your controller, or in AppController.php add the following like of code:

public $helpers = array('Ck')

4) In your layout file (default is in app/View/Layouts/default.ctp) add the following line in your <head> section:

echo $this->Html->script('ckeditor/ckeditor.js');

5) Now in your view file, when you want to call the CK editor, you can use:

echo $this->Ck->input('field_name');

Or

echo $this->Ck->input('Model.field_name');

Other options include:

echo $this->Ck->input('Model.field_name', array('label' => 'Custom Label'));

Hopefully this comes in use for some of you!


CKEditor上传图片配置PHP语言
http://www.chinaz.com/program/2009/1106/97143.shtml

http://www.cnblogs.com/davidhhuan/archive/2010/04/21/1716980.html
  评论这张
 
阅读(46)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017