1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/tests/Feature/PdfMaker/PdfMaker.php

48 lines
764 B
PHP
Raw Normal View History

<?php
namespace Tests\Feature\PdfMaker;
class PdfMaker
{
use PdfMakerUtilities;
protected $data;
public $design;
public $html;
public $document;
private $xpath;
2020-07-13 13:51:54 +02:00
public function __construct(array $data)
{
$this->data = $data;
}
public function design(string $design)
{
$this->design = new $design();
$this->initializeDomDocument();
return $this;
}
public function build()
{
// $raw = $this->design->html();
$this->updateElementProperties($this->data['template']);
2020-07-13 14:16:18 +02:00
$this->updateVariables($this->data['variables']);
return $this;
}
public function getCompiledHTML()
{
return $this->document->saveHTML();
}
}