original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Add attribute to element . Previously added attributes are not affected .