Exemple #1
0
 /**
  * Similarily to Wtk_Form_Model::addInstance, this function allow to
  * pass only the un prefixed control element name and its argumet or
  * the element instance.
  */
 function addChild($wid)
 {
     if (is_string($wid)) {
         $args = func_get_args();
         $method = 'add' . array_shift($args);
         $wid = call_user_func_array(array($this, $method), $args);
         return $wid;
     }
     return parent::addChild($wid);
 }
Exemple #2
0
 /**
  * Copy-pasted from Wtk_Form::addChild() :/
  */
 function addChild($wid)
 {
     $args = func_get_args();
     if (count($args) == 1 && $wid instanceof Wtk_Element) {
         return parent::addChild($wid);
     } else {
         $wid = call_user_func_array(array($this->getParent('Wtk_Form'), 'addChild'), $args);
         $wid->reparent($this);
     }
 }