Add (or replace) an selectize picker option.

@param  string $key The setting to add/replace.
@param  mixed  $val The setting's value to apply.
@throws InvalidArgumentException If the identifier is not a string.
@return self Chainable
515105
public function addSelectizeOption($key, $val)
    {
        if (!is_string($key)) {
            throw new InvalidArgumentException(
                'Setting key must be a string.'
            );
        }

        // Make sure default options are loaded.
        if ($this->selectizeOptions === null) {
            $this->selectizeOptions();
        }

        $this->selectizeOptions[$key] = $val;

        return $this;
    }
348487
public static function setContextDataByKey(string $key, $val)
    {
        $coroutineId = self::getcoroutine();
        self::$coroutineLocal[$coroutineId][self::COROUTINE_DATA][$key] = $val;
    }
974392
public function addPickerOption($key, $val)
    {
        if (!is_string($key)) {
            throw new InvalidArgumentException(
                'Setting key must be a string.'
            );
        }

        // Make sure default options are loaded.
        if ($this->pickerOptions === null) {
            $this->pickerOptions();
        }

        $this->pickerOptions[$key] = $val;

        return $this;
    }
1374091
public function write($key, $val)
    {
        $key = strval($key);

        if(strlen($key) == 0)
        {
            $msg = 'The key cannot be empty.';
            throw new InvalidArgumentException($msg);
        }

        $this->openSession();
        $_SESSION[$key] = $val;
        $this->closeSession();
    }
928341
public function virtual($key, $val) {
		$this->vFields[$key]=$val;
		if (!empty($this->whitelist)) {
			$this->whitelist[] = $key;
			$this->whitelist = array_unique($this->whitelist);
		}
	}
1262292
public function set($key, $val)
    {
        // set the variable
        if (empty($key)) return $this;

        $node = new Node($this->mainNode, $key, $val);
        $this->mainNode->addChild($node);

        return $this;
    }
227411
public function assignByRef($key, &$val = null)
    {
        if (is_array($key)) {
            foreach ($key as $k => &$v) {
                $this->args[$k] = $v;
            }
        } else {
            $this->args[$key] = $val;
        }
        return $this;
    }
1040449
public function set($key, $val)
    {
        if (!$this->locked) {
            $this->options[$key] = $val;
        }

        return $this;
    }
558632
protected function input($key, $val)
    {
        $extra = [
            'type' => strtolower(__FUNCTION__),
        ];

        return $this->composeElement($key, $val, $extra, true);
    }
749006
public function set($key, $values, $replace = true)
    {
        if(!is_string($key) && !is_int($key)){
            throw new \InvalidArgumentException('$key expected to be string, got:'.gettype($key));
        }

        if( !is_string($values) && !is_array($values) ){
            throw new \InvalidArgumentException('$key expected to be string or array, got: '.gettype($key));
        }

        $values = array_values((array)$values);

        if (true === $replace || !isset($this->container[$key])) {
            $this->container[$key] = $values;
        } else {
            $this->container[$key] = array_merge($this->container[$key], $values);
        }
    }
664322
private function _setString($key, $val) {
		$this->_result = str_replace('{{' . $key . '}}', $val, $this->_result);
	}
1230597
public function setFilter($key, $callable)
    {
        if (!is_callable($callable)) {
            throw new InvalidArgumentException('Invalid callable for filter: "'.$key.'"');
        }
        if (!preg_match('/^'.self::KEY_REGEX.'$/', $key)) {
            throw new InvalidArgumentException('Invalid name for filter: "'.$key.'". The filter name can only contain alphanumeric characters and underscore.');
        }

        $this->filters[$key] = $callable;

        return $this;

    }
1347655
protected function selectizeVal($val)
    {
        if ($val === null) {
            return [];
        }

        $input   = $this->selectizeInput();
        $choices = [];

        if ($input instanceof SelectizeInput) {
            $choices = $input->selectizeVal($val);
        }

        return $choices;
    }
491682
protected function textarea($key, $val)
    {
        $value = null;
        $value = isset($val['value']) ? $val['value'] : '' ;
        unset($val['value']);

        $extra = ['type'  => 'textarea', 'value' => $value];

        return $this->composeElement($key, $val, $extra);
    }
1316614
public function setSize($val)
    {
        if (in_array($val, $this->bootstrapSizesAllowed) === false && is_null($val) === false){
            throw new \Lucid\Html\Exception\InvalidAttributeValue($this->instantiatorName, 'size', $val,  $this->bootstrapSizesAllowed);
        }

        $classesToRemove = [];
        foreach ($this->bootstrapSizesAllowed as $size) {
            $classesToRemove[] = $this->bootstrapSizePrefix.'-'.$size;
        }
        $this->removeClass($classesToRemove);

        if (is_null($val) === true) {
            return $this;
        } else {
            $this->addClass($this->bootstrapSizePrefix.'-'.$val);
            return $this;
        }
    }
1334654
protected function setValidationError($key, $val)
    {
        if (!in_array('submit', $val)) {
            // Is $validator is instance of ValidatorInterface and given key has error associated
            // then add a span tag below the input element and display error.
            if ($this->validator instanceof ValidatorInterface && $this->validator->hasError($key)) {
                $this->elements[self::$formHolder[self::$formName]][$key.'.error'] =
                    '<span class="'.$this->errorClass.'">'.$this->validator->getErrors($key).'</span>'.PHP_EOL;
            }
        }
    }
521478
public function increment($key, $val = 1)
    {
        return apc_inc($this->conf['prefix'] . $key, abs(intval($val)));
    }