20 $action = $component->getAction();
21 if ($action !==
null) {
22 $tpl->setCurrentBlock(
"with_action");
23 $tpl->setVariable(
"ACTION", $component->getAction());
24 $tpl->parseCurrentBlock();
27 if ($component->isHighlighted()) {
28 $tpl->touchBlock(
"highlighted");
31 $tpl->setVariable(
"LABEL", $this->
txt($component->getAriaLabel()));
33 $tpl->touchBlock($component->getType());
37 $tpl->setCurrentBlock(
"with_id");
38 $tpl->setVariable(
"ID", $id);
39 $tpl->parseCurrentBlock();
43 foreach ($component->getCounters() as
$counter) {
44 if($largest_counter < $counter->getNumber()){
45 $largest_counter =
$counter->getNumber();
47 $n =
"counter_".$counter->getType();
49 $tpl->setVariable(strtoupper(
$n), $default_renderer->render(
$counter));
50 $tpl->parseCurrentBlock();
54 $tpl->setCurrentBlock(
"counter_spacer");
55 $tpl->setVariable(
"COUNTER_SPACER",$largest_counter);
56 $tpl->parseCurrentBlock();
An exception for terminatinating execution or to throw for unit testing.
getComponentInterfaceName()
@inheritdocs
render(Component\Component $component, RendererInterface $default_renderer)
@inheritdocs
Base class for all component renderers.
txt($id)
Get a text from the language file.
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.
checkComponent(Component $component)
Check if a given component fits this renderer and throw \LogicError if that is not the case.
A component is the most general form of an entity in the UI.
An entity that renders components to a string output.