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

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

Only framework developers should use this method.
protected initRecursive ( $namingContainer = null )
    protected function initRecursive($namingContainer = null)
    {
        $this->ensureChildControls();
        if ($this->getHasControls()) {
            if ($this instanceof INamingContainer) {
                $namingContainer = $this;
            }
            $page = $this->getPage();
            foreach ($this->_rf[self::RF_CONTROLS] as $control) {
                if ($control instanceof TControl) {
                    $control->_namingContainer = $namingContainer;
                    $control->_page = $page;
                    if ($control->_id === '' && $namingContainer) {
                        $control->generateAutomaticID();
                    }
                    $control->initRecursive($namingContainer);
                }
            }
        }
        if ($this->_stage < self::CS_INITIALIZED) {
            $this->_stage = self::CS_CHILD_INITIALIZED;
            if (($page = $this->getPage()) && $this->getEnableTheming() && !($this->_flags & self::IS_SKIN_APPLIED)) {
                $page->applyControlSkin($this);
                $this->_flags |= self::IS_SKIN_APPLIED;
            }
            if (isset($this->_rf[self::RF_ADAPTER])) {
                $this->_rf[self::RF_ADAPTER]->onInit(null);
            } else {
                $this->onInit(null);
            }
            $this->_stage = self::CS_INITIALIZED;
        }
    }

Usage Example

Пример #1
0
 /**
  * Performs the Init step for the control and all its child controls.
  * This method overrides the parent implementation by setting up
  * the stack of the output cache in the page.
  * Only framework developers should use this method.
  * @param TControl the naming container control
  */
 protected function initRecursive($namingContainer = null)
 {
     if ($this->_cacheAvailable && !$this->_dataCached) {
         $stack = $this->getPage()->getCachingStack();
         $stack->push($this);
         parent::initRecursive($namingContainer);
         $stack->pop();
     } else {
         parent::initRecursive($namingContainer);
     }
 }
TControl