bilingual-invoice-generator/show.php
Alexey Skobkin b49d840391
Draft.
2020-01-31 04:04:13 +03:00

20 lines
405 B
PHP

<?php
require_once __DIR__.'/vendor/autoload.php';
use App\Generator\InvoiceGenerator;
use Mpdf\Mpdf;
use Symfony\Component\Yaml\Yaml;
$config = Yaml::parseFile(__DIR__.'/config/parameters.yaml');
$pdf = $_GET['pdf'] ?? false;
if ($pdf) {
$mpdf = new Mpdf();
$mpdf->WriteHTML(InvoiceGenerator::generate($config));
$mpdf->Output();
} else {
echo InvoiceGenerator::generate($config);
}