7 use \ILIAS\UI\Implementation\Render\ResourceRegistry;
10 use \ILIAS\UI\Component\Component;
38 $this->ui_factory = $ui_factory;
39 $this->tpl_factory = $tpl_factory;
41 $this->js_binding = $js_binding;
47 $text = $component->text;
48 $component = $component->withAdditionalOnLoadCode(
function (
$id) use (
$text) {
49 return "id:$text.$id content:$text";
51 $this->bindOnloadCode($component);
53 return $component->text;
63 $binder = $component->getOnLoadCode();
64 $this->js_binding->addOnLoadCode($binder(
"id"));
Registry for resources required by rendered output like Javascript or CSS.
registerResources(ResourceRegistry $registry)
Announce resources this renderer requires.
An entity that renders components to a string output.
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
if(!array_key_exists('StateId', $_REQUEST)) $id
trait ComponentHelper
Provides common functionality for component implementations.
A component is the most general form of an entity in the UI.
__construct($ui_factory, $tpl_factory, $lng, $js_binding)
render(Component $component, DefaultRenderer $default_renderer)
bindOnloadCode(\ILIAS\UI\Component\JavaScriptBindable $component)
register($name)
Add a dependency.
Interface to be extended by components that have the possibility to bind to Javascript.