name = $name; return $this; } public function addElement($element) { if (is_string($element)) { $element = DependencyInjection::get($element); } $id = $element->getId(); if (!isset($this->elements[$id])) { $this->elements[$id] = $element; if ($element instanceof \ModulesGarden\ProxmoxAddon\Core\UI\Interfaces\AjaxElementInterface) { $this->mainContainer->addAjaxElement($this->elements[$id]); } } return $this; } /** * @param array $data * @return $this */ public function setData(array $data = []) { $this->data = $data; $this->updateData(); return $this; } protected function updateData() { foreach ($this->data as $key => $value) { if (property_exists($this, $key)) { $this->$key = $value; } } $this->data = []; return $this; } public function getHtml() { $this->runInitContentProcess(); if ($this->html === '') { $this->buildHtml(); } return $this->html; } }