コード例 #1
0
ファイル: FormControl.php プロジェクト: laiello/webuntucms
 /**
  * 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);
 }
コード例 #2
0
ファイル: Component.php プロジェクト: aeberh/php-movico
 public function addChild(Component $component)
 {
     $parentClass = get_class($this);
     if (get_class($this) == "HtmlComponent") {
         $parentClass = $this->getTagName();
     }
     $this->children[] = $component;
     $component->setParent($this);
 }
コード例 #3
0
 /**
  * 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);
 }
コード例 #4
0
 protected function onComponentAdded(Component &$component)
 {
     $component->setParent($this);
     $page = $this->getPage();
     if ($page != null) {
         if ($page->isInitialized()) {
             $component->internalInitialize();
         }
     }
     if ($this->isBeforePageRender()) {
         $component->beforePageRender();
     }
 }