PHP code example of tulparstudyo / sw-xlsx

1. Go to this page and download the library: Download tulparstudyo/sw-xlsx 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/ */

    

tulparstudyo / sw-xlsx example snippets


php artisan aimeos:jobs "product/export/xlsx" "default"
php artisan aimeos:jobs "product/import/xlsx" "default"

// Export xlsx file

$Xlsx = new \Aimeos\Controller\Jobs\Product\Export\Xlsx\Standard($this->get('context'), $this->get('aimeos'));
$files = $Xlsx->run();
if($files){
   $file_path = $files[0];
    header('Content-Type: application/download');
    header("Content-Disposition: attachment; filename=".$Xlsx->getXlsxFilename(1)); 
    header("Pragma: no-cache"); 
    header("Expires: 0"); 
    readfile($file_path);
    die();
}