Merge branch 'feature/invoice-print'

This commit is contained in:
Frank Schubert
2024-07-06 19:20:22 +02:00
4 changed files with 362 additions and 55 deletions
+4 -4
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;