Skip to content

Instantly share code, notes, and snippets.

@umidjons
Created January 31, 2014 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umidjons/8732226 to your computer and use it in GitHub Desktop.
Save umidjons/8732226 to your computer and use it in GitHub Desktop.
Use PHPExcel in Yii
$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