19 declare(strict_types=1);
39 $tpl_card = $this->
getTemplate(
"tpl.deck_card.html",
true,
true);
40 $tpl_row = $this->
getTemplate(
"tpl.deck_row.html",
true,
true);
42 foreach ($component->getCards() as $card) {
43 $tpl_card->setCurrentBlock(
"card");
44 $tpl_card->setVariable(
"CARD", $default_renderer->render($card));
45 $tpl_card->setVariable(
"SIZE_MD", $component->getCardsSizeForDisplaySize(
Component\Deck\
Deck::SIZE_M));
46 $tpl_card->setVariable(
"SIZE_SM", $component->getCardsSizeForDisplaySize(
Component\Deck\
Deck::SIZE_S));
48 $tpl_card->setVariable(
"SIZE_LG", $component->getCardsSizeForDisplaySize(
Component\Deck\
Deck::SIZE_L));
49 $tpl_card->parseCurrentBlock();
52 $this->
parseRow($tpl_row, $tpl_card->get());
54 return $tpl_row->get();
setCurrentBlock(string $name)
Set the block to work on.
setVariable(string $name, $value)
Set a variable in the current block.
render(Component\Component $component, RendererInterface $default_renderer)
getTemplate(string $name, bool $purge_unfilled_vars, bool $purge_unused_blocks)
Get template of component this renderer is made for.
cannotHandleComponent(Component $component)
This method MUST be called by derived component renderers, if.
parseCurrentBlock()
Parse the block that is currently worked on.
const SIZE_XS
Different sizes of the card.
parseRow(Template $tpl_row, string $content)
Base class for all component renderers.