最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Yii安裝與使用Excel擴(kuò)展的方法

 更新時(shí)間:2016年07月13日 11:33:23   作者:dreamzml  
這篇文章主要介紹了Yii安裝與使用Excel擴(kuò)展的方法,簡(jiǎn)單分析了Yii中Excel擴(kuò)展的下載、安裝及相關(guān)使用技巧,需要的朋友可以參考下

本文實(shí)例講述了Yii安裝與使用Excel擴(kuò)展的方法。分享給大家供大家參考,具體如下:

1.下載EExcelBehavior到項(xiàng)目擴(kuò)展目錄下

2.下載phpexcl到擴(kuò)展目錄

3.控制器調(diào)用:

/**
 * 導(dǎo)出列表,各商家保障金列表
 */
public function actionExport(){
  $model = $model=new Company('search');
  $model->unsetAttributes(); // clear any default values
  $model->zc_deposit_status = 2;//保障金審核通過(guò)的商家
  $companys = $model->search();
  $this->toExcel($companys,array('zc_name','zc_deposit'));
}
/**
 * 導(dǎo)出列表,商家保障金變動(dòng)明細(xì)
 */
public function actionExportDeposit($id){
  $model=new CmpDeposit('search');
  $model->unsetAttributes(); // clear any default values
  $model->zm_id = $id;
  $data = $model->search();
  $company = Company::model()->findByPk($id);
  $this->toExcel($data,'',$company->zc_name.'網(wǎng)鋪保障金明細(xì)');
}
public function behaviors()
{
  return array(
      'eexcelview'=>array(
          'class'=>'ext.eexcelview.EExcelBehavior',
      ),
  );
}

4.具體用法:

 * @param null string|CDataProvider|array $model the data provider for the grid.
 * @param null array $columns array with specif columns and its format. Defaults to all attributes.
 * @param null string $title title for the file
 * @param null array $documentDetails details of the document
 * @param null string $exportType format to export (Excel5,Excel2007, PDF, HTML, CSV). Defaults to Excel2007 (xlsx)
 */
public function toExcel($model=null, $columns=array(), $title=null, $documentDetails=array(), $exportType='Excel2007')

更多關(guān)于Yii相關(guān)內(nèi)容感興趣的讀者可查看本站專(zhuān)題:《Yii框架入門(mén)及常用技巧總結(jié)》、《php優(yōu)秀開(kāi)發(fā)框架總結(jié)》、《smarty模板入門(mén)基礎(chǔ)教程》、《php操作office文檔技巧總結(jié)(包括word,excel,access,ppt)》、《php面向?qū)ο蟪绦蛟O(shè)計(jì)入門(mén)教程》、《php字符串(string)用法總結(jié)》、《php+mysql數(shù)據(jù)庫(kù)操作入門(mén)教程》及《php常見(jiàn)數(shù)據(jù)庫(kù)操作技巧匯總

希望本文所述對(duì)大家基于Yii框架的PHP程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

合阳县| 将乐县| 敦煌市| 突泉县| 休宁县| 河南省| 廉江市| 怀柔区| 图片| 敦化市| 九龙坡区| 项城市| 道真| 宁夏| 淮滨县| 绥棱县| 香河县| 合水县| 宜昌市| 益阳市| 清水河县| 石柱| 庆阳市| 广水市| 和林格尔县| 上林县| 青冈县| 盐亭县| 龙江县| 台江县| 阿拉善右旗| 灵寿县| 中牟县| 收藏| 齐河县| 灵璧县| 宾川县| 淮南市| 阿城市| 孝昌县| 岚皋县|