PHP code example of firano / excelbundle

1. Go to this page and download the library: Download firano/excelbundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

firano / excelbundle example snippets

 php
    $bundles = array(
        // ...
        new Liuggio\ExcelBundle\LiuggioExcelBundle(),
    );
 php
    $loader->registerNamespaces(array(
        // ...
        'n3b\\Bundle\\Util\\HttpFoundation\\StreamResponse' => __DIR__.'/../vendor/n3b/src',
        'Liuggio'          => __DIR__.'/../vendor/bundles',
    ));
    $loader->registerPrefixes(array(
        // ...
        'PHPExcel'         => __DIR__.'/../vendor/phpexcel/Classes',
    ));

 php
    $bundles = array(
        // ...
        new Liuggio\ExcelBundle\LiuggioExcelBundle(),
    );
 php
   // create MS Excel5
   $excelService = $this->get('xls.service_xls5');
   // create pdf
   $this->get('xls.service_pdf');
   // create MS Excel 2007
   $this->get('xls.service_xls2007');

 php
    $excelObj = $this->get('xls.load_xls5')->load($filename);

 php
    
	public function indexAction($name)
    {
        $excelService = $this->get('xls.service_xls5');	

        //...create php excel object

        $excelService->getStreamWriter()->write( $filename );
    }