kematjaya / export
Installs: 1 806
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- dompdf/dompdf: ^2.0
- phpoffice/phpspreadsheet: ^1.16
- symfony/dom-crawler: ^5.2
- symfony/filesystem: ^4.0|^5.0
- symfony/http-foundation: ^4.0|^5.0
- symfony/serializer: ^4.0|^5.0
- ticketpark/htmlphpexcel: ^1.1
Requires (Dev)
- phpstan/phpstan: ^0.12.64
- phpunit/phpunit: ^9.4
- symfony/var-dumper: ^4.0|^5.0
README
- instalation
composer require kematjaya/export
- render HTML to PDF
use Kematjaya\Export\Manager\ExportManager;
use Kematjaya\Export\Processor\PDF\DOMPDFProcessor;
....
$data = '<h1>test pdf</h1>';
$manager = new ExportManager();
$doc = $manager->render($data, new DOMPDFProcessor('doc.pdf'));
- render HTML to Excel
use Kematjaya\Export\Manager\ExportManager;
use Kematjaya\Export\Processor\Excel\HtmlToExcel;
....
$data = '<h1>test pdf</h1>';
$manager = new ExportManager();
$excel = $manager->render($data, new HtmlToExcel('doc.xls'));
- render array to excel
use Kematjaya\Export\Manager\ExportManager;
use Kematjaya\Export\Processor\Excel\PHPSpreadsheetProcessor;
....
$data = [
['a', 'b', 'c']
];
$manager = new ExportManager();
$excel = $manager->render($data, new PHPSpreadsheetProcessor());