src/View/Helper/HtmlElementTrait.php
protected function htmlAttribs($attribs)
    {
        $html           = '';
        $escapeHtml     = $this->getView()->plugin('escapehtml');
        $escapeHtmlAttr = $this->getView()->plugin('escapehtmlattr');

        foreach ((array) $attribs as $key => $value) {
            $key = $escapeHtml($key);
            $this->cleanHtmlAttribValue($key, $value);
            if (!$value) {
                continue;
            }

            switch ($key) {
                case 'class':
                case 'href':
                    $value = $escapeHtml($value);
                    break;
                default:
                    $value = $escapeHtmlAttr($value);
                    break;
            }

            if ('id' == $key) {
                $value = $this->normalizeId($value);
            }
            
            $html .= $this->getKeyValuePair($key, $value);
        }

        return $html;
    }
protected function htmlAttribs($attribs)
    {
        $html           = '';
        $escapeHtml     = $this->getView()->plugin('escapehtml');
        $escapeHtmlAttr = $this->getView()->plugin('escapehtmlattr');

        foreach ((array) $attribs as $key => $value) {
            $key = $escapeHtml($key);
            $this->cleanHtmlAttribValue($key, $value);
            if (!$value) {
                continue;
            }

            switch ($key) {
                case 'class':
                case 'href':
                    $value = $escapeHtml($value);
                    break;
                default:
                    $value = $escapeHtmlAttr($value);
                    break;
            }

            if ('id' == $key) {
                $value = $this->normalizeId($value);
            }
            
            $html .= $this->getKeyValuePair($key, $value);
        }

        return $html;
    }
protected function htmlAttribs ( $ attribs ) { $ html = '' ; $ escapeHtml = $ this -> getView ( ) -> plugin ( 'escapehtml' ) ; $ escapeHtmlAttr = $ this -> getView ( ) -> plugin ( 'escapehtmlattr' ) ; foreach ( ( array ) $ attribs as $ key => $ value ) { $ key = $ escapeHtml ( $ key ) ; $ this -> cleanHtmlAttribValue ( $ key , $ value ) ; if ( ! $ value ) { continue ; } switch ( $ key ) { case 'class' : case 'href' : $ value = $ escapeHtml ( $ value ) ; break ; default : $ value = $ escapeHtmlAttr ( $ value ) ; break ; } if ( 'id' == $ key ) { $ value = $ this -> normalizeId ( $ value ) ; } $ html .= $ this -> getKeyValuePair ( $ key , $ value ) ; } return $ html ; }
Converts an associative array to a string of tag attributes.

@access public

@param array $attribs From this array, each key-value pair is
converted to an attribute name and value.

@return string The XHTML for the attributes.
Converts an associative array to a string of tag attributes .