Added basic placeholder providers for parts.

This commit is contained in:
Jan Böhmer 2020-04-14 17:21:30 +02:00
parent dee4094d8b
commit 7ce5776694
13 changed files with 521 additions and 3 deletions

View file

@ -29,18 +29,20 @@ class LabelHTMLGenerator
{
protected $twig;
protected $elementTypeNameGenerator;
protected $replacer;
public function __construct(ElementTypeNameGenerator $elementTypeNameGenerator, Environment $twig)
public function __construct(ElementTypeNameGenerator $elementTypeNameGenerator, LabelTextReplacer $replacer, Environment $twig)
{
$this->twig = $twig;
$this->elementTypeNameGenerator = $elementTypeNameGenerator;
$this->replacer = $replacer;
}
public function getLabelHTML(LabelOptions $options, object $element): string
{
return $this->twig->render('labels/base_label.html.twig', [
'meta_title' => $this->getPDFTitle($options, $element),
'lines' => $options->getLines(),
'lines' => $this->replacer->replace($options->getLines(), $element),
]);
}