mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 10:49:00 +02:00
Added basic placeholder providers for parts.
This commit is contained in:
parent
dee4094d8b
commit
7ce5776694
13 changed files with 521 additions and 3 deletions
|
@ -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),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue