Prado\Web\UI\WebControls\TConditional::createChildControls PHP Method

createChildControls() public method

This method overrides the parent implementation. It evaluates {@link getCondition Condition} and instantiate the corresponding template.
public createChildControls ( )
    public function createChildControls()
    {
        $this->_creatingChildren = true;
        $result = true;
        try {
            $result = $this->getTemplateControl()->evaluateExpression($this->_condition);
        } catch (\Exception $e) {
            throw new TInvalidDataValueException('conditional_condition_invalid', $this->_condition, $e->getMessage());
        }
        if ($result) {
            if ($this->_trueTemplate) {
                $this->_trueTemplate->instantiateIn($this->getTemplateControl(), $this);
            }
        } else {
            if ($this->_falseTemplate) {
                $this->_falseTemplate->instantiateIn($this->getTemplateControl(), $this);
            }
        }
        $this->_creatingChildren = false;
    }