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);
    }
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);
    }
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 ) ; }
Adds button.

@param string|array $label label of button
@param string $class optional name of button class

@return Button
Adds button .