Convert a set of options to HTML attributes

Parameters

  • array $params
  • string $method
  • array $options

Returns

string

Source

						protected function _attributes($params, $method = null, array $options = array()) {
		$defaults = array('escape' => true, 'prepend' => ' ', 'append' => '');
		$options += $defaults;
		$result = array();

		if (!is_array($params)) {
			return !$params ? '' : $options['prepend'] . $params;
		}
		foreach ($params as $key => $value) {
			if ($next = $this->_attribute($key, $value, $options)) {
				$result[] = $next;
			}
		}
		return $result ? $options['prepend'] . implode(' ', $result) . $options['append'] : '';
	}