28 $tpl_name =
"tpl.standard.html";
32 $items = $component->getItems();
33 if (count($items) == 0) {
39 $label = $component->getLabel();
40 if ($label !== null) {
41 $tpl->setVariable(
"LABEL", $component->getLabel());
43 $tpl->setVariable(
"LABEL",
"");
57 foreach ($items as $item) {
58 $tpl->setCurrentBlock(
"item");
59 $tpl->setVariable(
"ITEM", $default_renderer->render($item));
60 $tpl->parseCurrentBlock();
69 $tpl->setCurrentBlock($block);
70 $tpl->setVariable($template_var,
$id);
71 $tpl->parseCurrentBlock();
85 assert(is_string($block));
87 $clone->touch_blocks[] = $block;
97 parent::registerResources($registry);
98 $registry->
register(
'./src/UI/templates/js/Dropdown/dropdown.js');
withBlocksToBeTouched($block)
Append a block to touch during rendering and return cloned instance.
renderDropdown(Component\Dropdown\Dropdown $component, RendererInterface $default_renderer)
Registry for resources required by rendered output like Javascript or CSS.
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
registerResources(ResourceRegistry $registry)
Announce resources this renderer requires.null
if(!array_key_exists('StateId', $_REQUEST)) $id
renderItems($items, $tpl, $default_renderer)
maybeRenderId(Component\Component $component, $tpl, $block, $template_var)
render(Component\Component $component, RendererInterface $default_renderer)
Create styles array
The data for the language used.
register($name)
Add a dependency.
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.
getComponentInterfaceName()
Base class for all component renderers.
This implements commonalities between different types of Dropdowns.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.