Prado\Web\UI\JuiControls\TJuiControlOptions::__set PHP Метод

__set() публичный Метод

Sets a named options with a value. Options are used to store and retrive named values for the javascript control.
public __set ( $name, $value )
    public function __set($name, $value)
    {
        if ($this->_options === null) {
            $this->_options = array();
        }
        foreach ($this->_control->getValidOptions() as $option) {
            if (0 == strcasecmp($name, $option)) {
                $low = strtolower($value);
                if ($low === 'null') {
                    $this->_options[$option] = null;
                } elseif ($low === 'true') {
                    $this->_options[$option] = true;
                } elseif ($low === 'false') {
                    $this->_options[$option] = false;
                } elseif (is_numeric($value)) {
                    // trick to get float or integer automatically when needed
                    $this->_options[$option] = $value + 0;
                } elseif (substr($low, 0, 8) == 'function') {
                    $this->_options[$option] = new TJavaScriptLiteral($value);
                } else {
                    $this->_options[$option] = $value;
                }
                return;
            }
        }
        throw new TConfigurationException('juioptions_option_invalid', $this->_control->ID, $name);
    }