Created
January 31, 2014 13:39
-
-
Save umidjons/8732226 to your computer and use it in GitHub Desktop.
Use PHPExcel in Yii
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$phpExcelPath = Yii::getPathOfAlias( 'ext' ); | |
spl_autoload_unregister( array( 'YiiBase', 'autoload' ) ); | |
$p = $phpExcelPath . DIRECTORY_SEPARATOR . 'PHPExcel.php'; | |
include( $p ); | |
$objPhpExcel = new PHPExcel(); | |
$worksheet = $objPhpExcel->getSheet()->setTitle( "Данные из 1С" ); | |
$worksheet->setCellValueByColumnAndRow( 0, 1, 'Some value' ); | |
PHPExcel_IOFactory::createWriter( $objPhpExcel, 'Excel2007' )->save( $file_name ); | |
spl_autoload_register( array( 'YiiBase', 'autoload' ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment