12use \ILIAS\UI\Implementation\Render\Template;
34 $tpl_name =
"tpl.standard.html";
39 if (is_array($items) && count($items) == 0) {
46 if ($label !==
null) {
49 $tpl->setVariable(
"LABEL",
"");
57 : $this->
txt(
"actions");
58 $tpl->setCurrentBlock(
"aria_label");
59 $tpl->setVariable(
"ARIA_LABEL", $aria_label);
60 $tpl->parseCurrentBlock();
70 foreach ($items as $item) {
71 $tpl->setCurrentBlock(
"item");
72 $tpl->setVariable(
"ITEM", $default_renderer->render($item));
73 $tpl->parseCurrentBlock();
82 $tpl->setCurrentBlock($block);
83 $tpl->setVariable($template_var, $id);
84 $tpl->parseCurrentBlock();
93 parent::registerResources($registry);
94 $registry->
register(
'./src/UI/templates/js/Dropdown/dropdown.js');
An exception for terminatinating execution or to throw for unit testing.
This implements commonalities between different types of Dropdowns.
getComponentInterfaceName()
Get the name of the component-interface this renderer is supposed to render.ATTENTION: Fully qualifie...
renderItems(array $items, Template $tpl, RendererInterface $default_renderer)
registerResources(ResourceRegistry $registry)
Announce resources this renderer requires.null
maybeRenderId(JavaScriptBindable $component, Template $tpl, $block, $template_var)
renderDropdown(Dropdown $component, RendererInterface $default_renderer)
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.
Interface to be extended by components that have the possibility to bind to Javascript.
render(Component $component, Renderer $default_renderer)
Render the component if possible and delegate additional rendering to the default_renderer.
Registry for resources required by rendered output like Javascript or CSS.
register($name)
Add a dependency.
Interface to templating as it is used in the UI framework.
An entity that renders components to a string output.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.