original_string: public function addButton($label, $class = 'Button')
      {
          if (!$this->buttonset) {
              $this->buttonset = $this->add('ButtonSet', null, 'grid_buttons')->setClass('atk-actions');
          }
  
          return $this->buttonset
              ->add($class, 'gbtn'.count($this->elements))
              ->set($label);
      }
code: public function addButton($label, $class = 'Button')
      {
          if (!$this->buttonset) {
              $this->buttonset = $this->add('ButtonSet', null, 'grid_buttons')->setClass('atk-actions');
          }
  
          return $this->buttonset
              ->add($class, 'gbtn'.count($this->elements))
              ->set($label);
      }
code_tokens: public function addButton ( $ label , $ class = 'Button' ) { if ( ! $ this -> buttonset ) { $ this -> buttonset = $ this -> add ( 'ButtonSet' , null , 'grid_buttons' ) -> setClass ( 'atk-actions' ) ; } return $ this -> buttonset -> add ( $ class , 'gbtn' . count ( $ this -> elements ) ) -> set ( $ label ) ; }
docstring: Adds button.
  
  @param string|array $label label of button
  @param string $class optional name of button class
  
  @return Button
docstring_tokens: Adds button .