【转】Yii的一些常用扩展(第三方类)

1。我上篇帖的phpexcel。具体用法请看我上篇帖子。优点是功能全,可以读写excel,pdf文件等。缺点可能就是比较复杂,包比较大。

2。php-excel-reader ,读取excel的包。http://www.yiiframework.com/extension/php-excel-reader

     要求 :yii 1.0以上版本,包括1.0

    安装 :Extract the release file under protected/extensions

用法:

Yii::import('ext.phpexcelreader.JPhpExcelReader');$data=new JPhpExcelReader('example.xls');echo $data->dump(true,true);3。CKEditor 富文本框。 http://www.yiiframework.com/extension/ckeditor-integration 要求: yii 1.0以及以上版本;ckeditor 3.4以及以上版本 安装:
  • Extract the release file under protected/extensions
  • 下载CKeditor ,并放到项目的根目录下。下载地址:http://ckeditor.com/download 【把从上面的链接中下载的文件夹放到protected/extensions下】

       用法:

    $this->widget('ext.ckeditor.CKEditorWidget',array( "model"=>$pages, # Data-Model "attribute"=>'content', # Attribute in the Data-Model "defaultValue"=>"Test Text", # Optional # Additional Parameter (Check http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html) "config" => array( "height"=>"400px", "width"=>"100%", "toolbar"=>"Basic", ), #Optional address settings if you did not copy ckeditor on application root "ckEditor"=>Yii::app()->basePath."/../ckeditor/ckeditor.php", # Path to ckeditor.php "ckBasePath"=>Yii::app()->baseUrl."/ckeditor/", # Realtive Path to the Editor (from Web-Root) ) );如果你想学习更多的配置方法,请阅读CKEditor的API。4。KindeEditor 富文本框。这个是我自己集成进yii中的。要求:yii 1.0及以上版本安装:下载kindeditor,并解压,把attached,php,plugis,skins,kindeditor.js复制到js文件夹下。 把kindeditor.css负责到css文件夹下。其中,php文件夹是负责上传文件的。也可以替换成其他语言的。具体的上传功能的实现都在php文件夹下。用法:<script language="javascript" type="text/javascript">
    KE.show({
         id : 'content1',
         cssPath : '../../css/kindeditor.css',
        allowFileManager : true,
         afterCreate : function(id) {
          KE.event.ctrl(document, 13, function() {
           KE.util.setData(id);
           document.forms['example'].submit();
          });
          KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
           KE.util.setData(id);
           document.forms['example'].submit();
          });
         }
        });</script>
    <?php echo $htmlData; ?>
    <form name="example" method="post" action="sendemail">
                <ul>
                 <li>
                         <textarea id="content1" name="content1" cols="100" rows="8" style="width:700px;height:200px;visibility:hidden;"><?php echo htmlspecialchars($htmlData); ?></textarea>
                        </li> <li>
              <input type="submit" name="button" value="提交内容" /> (提交快捷键: Ctrl + Enter)
                        </li>
                </ul>           
    </form>更多用法,请参考kindeditor的官方API。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值