Sets ol attributes [5.0.0]

@param callable $list
@param array    $attributes = []

@return string
484119
public function ol(Callable $list, Array $attributes = []) : String
    {
        return $this->ul($list, $attributes, 'ol');
    }
627618
public function attr(array $attributes)
    {
        $result = '';

        foreach ($attributes as $attribute => $value) {
            $result .= ' '.(is_int($attribute) ? $value : $attribute.'="'.str_replace('"', '&quot;', $value).'"');
        }

        return $result;
    }
734920
public function setList($list)
    {
        $this->list = $list;
        $this->failover = $this->list;
        return $this;
    }
277233
public static function arrayToAttributes(array $attributes)
	{
		//Build a list of single attributes first
		$attributeList = array();

		foreach ( $attributes as $key => $value )
		{
			// If the value is not false add the attribute. This allows attributes to not be shown.
			if ( $value !== false )
			{
				if ( is_string($key) )
				{
					$attributeList[] = htmlspecialchars($key) . '="' . htmlspecialchars($value) . '"';
				}
				else
				{
					$attributeList[] = $value;
				}
			}
		}

		return implode(' ', $attributeList);
	}
160453
protected function attributes($attributes = [])
    {
        $ar = [];

        foreach ($attributes as $key => $value) {
            $element = $this->attribute($key, $value);
            if (!is_null($element)) {
                $ar[] = $element;
            }
        }

        return count($ar) > 0 ? ' '.implode(' ', $ar) : '';
    }
467683
public function dl(array $list, array $attributes = [])
    {
        $attributes = $this->attributes($attributes);

        $html = "<dl{$attributes}>";

        foreach ($list as $key => $value) {
            $value = (array) $value;

            $html .= "<dt>$key</dt>";

            foreach ($value as $v_key => $v_value) {
                $html .= "<dd>$v_value</dd>";
            }
        }

        $html .= '</dl>';

        return $this->toHtmlString($html);
    }
359708
public function _setAttributes($attributes)
    {
        if (is_array($attributes)) {
            foreach ($attributes as $attribute => $value) {
                $this->{$attribute} = $value;
            }

            return $this;
        }

        //@todo: put real exception here cos exception' gon be thrown either ways, so put one that makes sense
        //or something else that has more meaning
        throw new \InvalidArgumentException('Invalid argument Passed to set attributes on object');
    }
349357
private function _toFormatTree($list, $level = 0)
    {
        $formatTree = [];
        foreach ($list as $val) {
            $tmp_str = str_repeat($this->tabSize, $level);
            $tmp_str .= "└&nbsp;";
            
            $val['level'] = intval($level);
            $val[$this->showTitleField] = $level == 0 ? $val[$this->showTitleField] : $tmp_str . $val[$this->showTitleField];
            if (!array_key_exists('_child', $val)) {
                array_push($formatTree, $val);
            } else {
                $tmp_ary = $val['_child'];
                unset($val['_child']);
                array_push($formatTree, $val);
                $formatTree = array_merge($formatTree, $this->_toFormatTree($tmp_ary, $level + 1));
            }
        }
        
        return $formatTree;
    }
1133756
public function setAttributes($attributes)
    {
        foreach ($attributes as $attribute => $value) {
            if ($attribute === 'class') {
                $this->addClass($value);
                continue;
            }

            if (is_int($attribute)) {
                $attribute = $value;
                $value = '';
            }

            $this->setAttribute($attribute, (string) $value);
        }

        return $this;
    }
218569
private function prepareAttributes($attributes = array())
    {
        if (!is_array($attributes)) {
            throw new InvalidArgumentException("[ImBundle] format attributes must be an array, recieved: " . var_export($attributes, true));
        }
        $result = "";
        foreach ($attributes as $key => $value) {
            if ($key === null || $key === "") {
                $result .= " " . $value;
            } else {
                $result .= " -" . $key;
                if ($value != "") {
                    $result .= " \"" . $value . "\"";
                }
            }
        }

        return $result;
    }
1352513
public function setAttributes(array $attributes)
    {
        $this->attributes = [];
        foreach ($attributes as $attribute => $value) {
            $this->addAttribute($attribute, $value);
        }

        return $this;
    }
1237253
public function setAttributes(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            $this->setAttribute($attribute, $value);
        }
    }
801758
protected function listing($type, $list, $attributes = array())
    {
        $html = self::getInstance()->html;
        $args = func_get_args();
        return call_user_func_array(array($html, __FUNCTION__), $args);
    }
65982
public function setAttributes(array $attributes = [])
    {
        $this->attributes = array_merge($this->attributes, $attributes);

        $this->validateAttributes();

        $this->decoupleOptionsFromAttributes();

        return $this;
    }
63081
public function setAttributes(array $attributes = null)
    {
        $this->attributes = array_merge($this->attributes, $attributes);
        return $this;
    }
906704
public function setList($list = [])
    {
        if (!is_array($list)) {
            $list = ArrayUtils::iteratorToArray($list);
        }

        $this->list = $list;
    }
688106
public function setAttributes($attributes)
    {
        if (! is_array($attributes)) {
            $attributes = [$attributes];
        }

        $this->attributes = $attributes;

        return $this;
    }