protected function getHtmlAttributes($attributes) {
		$list = array();
		foreach ($attributes as $name=>$value) {
			if (!empty($value)) {
				if (is_scalar($value)) {
					$list[] = "$name='" . htmlentities($value, ENT_QUOTES, "UTF-8") . "'";
				} elseif (is_array($value)) {
					$list[] = $this->getHtmlAttributes($value);
				}
			}
		}
		if (count($list)>0) {
			return " " . implode(" ", $list);
		}

		return "";
	}
protected function getHtmlAttributes($attributes) {
		$list = array();
		foreach ($attributes as $name=>$value) {
			if (!empty($value)) {
				if (is_scalar($value)) {
					$list[] = "$name='" . htmlentities($value, ENT_QUOTES, "UTF-8") . "'";
				} elseif (is_array($value)) {
					$list[] = $this->getHtmlAttributes($value);
				}
			}
		}
		if (count($list)>0) {
			return " " . implode(" ", $list);
		}

		return "";
	}
protected function getHtmlAttributes ( $ attributes ) { $ list = array ( ) ; foreach ( $ attributes as $ name => $ value ) { if ( ! empty ( $ value ) ) { if ( is_scalar ( $ value ) ) { $ list [ ] = "$name='" . htmlentities ( $ value , ENT_QUOTES , "UTF-8" ) . "'" ; } elseif ( is_array ( $ value ) ) { $ list [ ] = $ this -> getHtmlAttributes ( $ value ) ; } } } if ( count ( $ list ) > 0 ) { return " " . implode ( " " , $ list ) ; } return "" ; }
Turns a list of attributes provided as an associative array into an equivalent string
of HTML attributes that can be inserted into a HTML tag. Skips any attributes that
are considered empty.

For example uses, please see the DefaultSnippets class.

@param $attributes
@return string
Turns a list of attributes provided as an associative array into an equivalent string of HTML attributes that can be inserted into a HTML tag . Skips any attributes that are considered empty .