/** * Overloaded parent setter. This method checks for invalid control name. * @param IComponentContainer * @param string * @return void */ public function setParent(IComponentContainer $parent = NULL, $name = NULL) { if ($name === 'submit') { throw new InvalidArgumentException("Name 'submit' is not allowed due to JavaScript limitations."); } parent::setParent($parent, $name); }
public function addChild(Component $component) { $parentClass = get_class($this); if (get_class($this) == "HtmlComponent") { $parentClass = $this->getTagName(); } $this->children[] = $component; $component->setParent($this); }
/** * Adiciona um componente como filho desse componente. * @param Component $child O filho que será adicionado. * @return Component O filho recém adicionado. * @throws LogicException Se o componente já for filho de outro pai. */ public function addChild(Component $child) { $this->children[$child->hashCode()] = $child; return $child->setParent($this); }
protected function onComponentAdded(Component &$component) { $component->setParent($this); $page = $this->getPage(); if ($page != null) { if ($page->isInitialized()) { $component->internalInitialize(); } } if ($this->isBeforePageRender()) { $component->beforePageRender(); } }