public function setAttr($attribute, $value = null)
    {
        if (is_array($attribute) && is_null($value)) {
            foreach ($attribute as $k => $v) {
                $this->setAttr($k, $v);
            }

            return $this;
        }
        $this->template->appendHTML('attributes', ' '.$attribute.'="'.$value.'"');

        return $this;
    }
public function setAttr($attribute, $value = null)
    {
        if (is_array($attribute) && is_null($value)) {
            foreach ($attribute as $k => $v) {
                $this->setAttr($k, $v);
            }

            return $this;
        }
        $this->template->appendHTML('attributes', ' '.$attribute.'="'.$value.'"');

        return $this;
    }
public function setAttr ( $ attribute , $ value = null ) { if ( is_array ( $ attribute ) && is_null ( $ value ) ) { foreach ( $ attribute as $ k => $ v ) { $ this -> setAttr ( $ k , $ v ) ; } return $ this ; } $ this -> template -> appendHTML ( 'attributes' , ' ' . $ attribute . '="' . $ value . '"' ) ; return $ this ; }
Add attribute to element. Previously added attributes are not affected.

@param string|array $attribute Name of the attribute, or hash
@param string       $value     New value of the attribute

@return $this
Add attribute to element . Previously added attributes are not affected .