code: public function addClass($spec)
      {
          $class = array();
          if ($this->hasAttribute('class')) {
              $class = $this->getAttribute('class');
          }
          if (!is_array($class)) {
              $class = explode(' ', $class);
          }
          if (!in_array($spec, $class)) {
              $class[] = $spec;
          }
          $this->setAttribute('class', implode(' ', $class));
          return $this;
      }
docs: @param $spec
  
  @return $this