日期:2014-05-16 浏览次数:20505 次
public function actionExcel(){
$excel_path = dirname(__FILE__) . '/../../files/users.xlsx';
Yii::import('ext.phpexcel.Classes.*');
//关闭yii的自动装载
spl_autoload_unregister(array('YiiBase','autoload'));
include 'PHPExcel/IOFactory.php';
$objPHPExcel = PHPExcel_IOFactory::load($excel_path);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
var_dump($sheetData);
//恢复yii的自动装载
spl_autoload_register(array('YiiBase','autoload'));
}