PHP code example of row-bloom / spreadsheet-data-loader
1. Go to this page and download the library: Download row-bloom/spreadsheet-data-loader 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/ */
row-bloom / spreadsheet-data-loader example snippets
use RowBloom\RowBloom\Support;
use RowBloom\SpreadsheetDataLoader\SpreadsheetDataLoader;
app()->make(Support::class)
->registerDataLoaderDriver(SpreadsheetDataLoader::NAME, SpreadsheetDataLoader::class);
use RowBloom\SpreadsheetDataLoader\SpreadsheetDataLoader;
use RowBloom\RowBloom\Interpolators\PhpInterpolator;
use RowBloom\RowBloom\Renderers\HtmlRenderer;
use RowBloom\RowBloom\RowBloom;
app()->get(RowBloom::class)
->addTablePath('foo.csv')
->addTablePath('bar.xlsx')
->setInterpolator(PhpInterpolator::NAME)
->setTemplate('
<h1>{{ title }}</h1>
<p>Bold text</p>
<div>{{ body }}</div>
')
->setRenderer(HtmlRenderer::class)
->save(__DIR__.'/foo.pdf');