bilingual-invoice-generator/show.php

20 lines
405 B
PHP
Raw Normal View History

2020-01-31 01:04:13 +00:00
<?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);
}