예제 #1
0
 function addChild(WFView $view)
 {
     if (!$view instanceof WFPassword) {
         throw new WFException("Only WFPassword child views are accepted.");
     }
     if ($this->confirmPasswordId !== NULL) {
         throw new WFException("WFPassword accepts only one child.");
     }
     $this->confirmPasswordId = $view->id();
     $this->setValueForKey(false, 'autocomplete');
     $view->setValueForKey(false, 'autocomplete');
     return parent::addChild($view);
 }
예제 #2
0
 /**
  *  To implement our prototype functionality, we need to detect when a child object named "<id>Prototype" has been added.
  *
  *  If a prototype object is detected, we set up the prototype for the WFDynamic.
  *
  *  @param object WFView The object being added.
  */
 function addChild(WFView $view)
 {
     if ($view->id() == "{$this->id}Prototype") {
         $this->setPrototype($view);
     } else {
         // add new view to the "parentView" object
         $parentView = $this->calculateParent();
         if ($parentView) {
             $parentView->addChild($view);
         } else {
             parent::addChild($view);
         }
     }
 }
예제 #3
0
파일: WFView.php 프로젝트: apinstein/phocoa
 /**
  * Add a child view to this view.
  *
  * @param object A WFView object to add.
  */
 function addChild(WFView $view)
 {
     $this->children[$view->id()] = $view;
     $view->setParent($this);
 }