18 $tpl_card = $this->
getTemplate(
"tpl.deck_card.html",
true,
true);
19 $tpl_row = $this->
getTemplate(
"tpl.deck_row.html",
true,
true);
21 $size = $component->getCardsSize();
22 $small_size = $component->getCardsSizeSmallDisplays();
23 $cards_per_row = 12 /
$size;
27 foreach ($component->getCards() as $card) {
28 $tpl_card->setCurrentBlock(
"card");
29 $tpl_card->setVariable(
"CARD", $default_renderer->render($card, $default_renderer));
30 $tpl_card->setVariable(
"SIZE",
$size);
31 $tpl_card->setVariable(
"SMALL_SIZE", $small_size);
32 $tpl_card->parseCurrentBlock();
34 if ((
$i % $cards_per_row) == 0) {
35 $this->
parseRow($tpl_row, $tpl_card->get());
36 $tpl_card = $this->
getTemplate(
"tpl.deck_card.html",
true,
true);
42 $this->
parseRow($tpl_row, $tpl_card->get());
44 return $tpl_row->get();
47 protected function parseRow($tpl_row, $content)
49 $tpl_row->setCurrentBlock(
"row");
50 $tpl_row->setVariable(
"CARDS", $content);
51 $tpl_row->parseCurrentBlock();
parseRow($tpl_row, $content)
getComponentInterfaceName()
render(Component\Component $component, RendererInterface $default_renderer)
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.
Base class for all component renderers.