public function appendAttribute($name, $value, $option = TRUE)
	{
		if (is_array($value)) {
			$prev = isset($this->attrs[$name]) ? (array)$this->attrs[$name] : [];
			$this->attrs[$name] = $value + $prev;

		} elseif ((string)$value === '') {
			$tmp = &$this->attrs[$name]; // appending empty value? -> ignore, but ensure it exists

		} elseif (!isset($this->attrs[$name]) || is_array($this->attrs[$name])) { // needs array
			$this->attrs[$name][$value] = $option;

		} else {
			$this->attrs[$name] = [$this->attrs[$name] => TRUE, $value => $option];
		}

		return $this;
	}
public function appendAttribute($name, $value, $option = TRUE)
	{
		if (is_array($value)) {
			$prev = isset($this->attrs[$name]) ? (array)$this->attrs[$name] : [];
			$this->attrs[$name] = $value + $prev;

		} elseif ((string)$value === '') {
			$tmp = &$this->attrs[$name]; // appending empty value? -> ignore, but ensure it exists

		} elseif (!isset($this->attrs[$name]) || is_array($this->attrs[$name])) { // needs array
			$this->attrs[$name][$value] = $option;

		} else {
			$this->attrs[$name] = [$this->attrs[$name] => TRUE, $value => $option];
		}

		return $this;
	}
public function appendAttribute ( $ name , $ value , $ option = TRUE ) { if ( is_array ( $ value ) ) { $ prev = isset ( $ this -> attrs [ $ name ] ) ? ( array ) $ this -> attrs [ $ name ] : [ ] ; $ this -> attrs [ $ name ] = $ value + $ prev ; } elseif ( ( string ) $ value === '' ) { $ tmp = & $ this -> attrs [ $ name ] ; // appending empty value? -> ignore, but ensure it exists } elseif ( ! isset ( $ this -> attrs [ $ name ] ) || is_array ( $ this -> attrs [ $ name ] ) ) { // needs array $ this -> attrs [ $ name ] [ $ value ] = $ option ; } else { $ this -> attrs [ $ name ] = [ $ this -> attrs [ $ name ] => TRUE , $ value => $ option ] ; } return $ this ; }
Appends value to element's attribute.

@param  string
@param  string|array value to append
@param  string|bool value option
@return self
Appends value to element s attribute .