34 $this->components = array();
35 $this->htmlComponents = array();
47 public function compile($internal =
false) {
48 if ($internal ===
false && $this->autoCompile ===
true)
49 throw new \Exception(
"Impossible to compile if autoCompile is set to 'true'");
50 foreach ($this->components as $component) {
51 $component->compile();
60 if ($this->autoCompile) {
61 if ($attachTo != null) {
62 if (! isset($this->components[$attachTo])) {
63 $this->components[$attachTo] = $component;
65 $this->components[] = $component;
67 $component->
attach($attachTo);
69 $this->components[] = $component;
73 if (\is_array($params))
79 $this->htmlComponents[$htmlComponent->
getIdentifier()] = $htmlComponent;
80 return $htmlComponent;
84 foreach ($this->htmlComponents as $htmlComponent) {
85 $htmlComponent->compile(
$js, $view);
90 return array_filter($this->htmlComponents, $callback);
94 return $this->htmlComponents[$identifier]??
'';
98 $this->htmlComponents=[];
BaseHtml for HTML components.
addHtmlComponent(BaseHtml $htmlComponent)
setAutoCompile($autoCompile)
Base component for JQuery UI visuals components.
getHtmlComponent($identifier)
addComponent(SimpleComponent $component, $attachTo, $params)
compileHtml(JsUtils $js=NULL, &$view=NULL)
__construct($autoCompile=true)
matchHtmlComponents($callback)