implemented first version of invoice printing

This commit is contained in:
2024-07-05 13:10:56 +02:00
parent 79e8cda5e5
commit 91938a0987
4 changed files with 362 additions and 56 deletions

View File

@@ -16,23 +16,23 @@ class PdfForm {
}
public function render() {
public function render($additionalArgs = false): string {
$this->layout->setTemplate($this->template);
$this->layout->set("ressourcePathPrefix", BASEDIR."/public/");
foreach($this->variables as $name => $value) {
$this->layout->set($name, $value);
}
$fullpath = $this->layout->renderPDF();
$fullpath = $this->layout->renderPDF(false, $additionalArgs);
$this->fullpath = $fullpath;
$this->returnValues = $this->layout->getReturnedValue();
return $fullpath;
}
public function download($filename = false) {
public function download($filename = false, $additionalArgs = false) {
if(!$this->fullpath) {
$this->render();
$this->render($additionalArgs);
}
$filepath = $this->fullpath;