Prado\Web\UI\TCompositeControl::initRecursive PHP Метод

initRecursive() защищенный Метод

This method overrides the parent implementation by ensuring child controls are created first. Only framework developers should use this method.
protected initRecursive ( $namingContainer = null )
    protected function initRecursive($namingContainer = null)
    {
        $this->ensureChildControls();
        parent::initRecursive($namingContainer);
    }

Usage Example

Пример #1
0
 /**
  * Performs the OnInit step for the control and all its child controls.
  * This method overrides the parent implementation
  * by ensuring child controls are created first,
  * and if master class is set, master will be applied.
  * Only framework developers should use this method.
  * @param TControl the naming container control
  */
 protected function initRecursive($namingContainer = null)
 {
     $this->ensureChildControls();
     if ($this->_masterClass !== '') {
         $master = Prado::createComponent($this->_masterClass);
         if (!$master instanceof TTemplateControl) {
             throw new TInvalidDataValueException('templatecontrol_mastercontrol_invalid');
         }
         $this->_master = $master;
         $this->getControls()->clear();
         $this->getControls()->add($master);
         $master->ensureChildControls();
         foreach ($this->_contents as $id => $content) {
             $master->injectContent($id, $content);
         }
     } else {
         if (!empty($this->_contents)) {
             throw new TConfigurationException('templatecontrol_mastercontrol_required', get_class($this));
         }
     }
     parent::initRecursive($namingContainer);
 }
TCompositeControl