public function addButton(string $title = null, array $options = []): string
    {
        if (!$title) {
            $title = __d('ck_tools', 'add');
        }
        $options = Hash::merge([
            'url' => null,
            'icon' => 'fa fa-plus',
            'class' => 'btn btn-default btn-xs btn-add',
        ], $options);
        $url = $options['url'];
        if (!$url) {
            $url = ['action' => 'add'];
            $url = $this->augmentUrlByBackParam($url);
        }
        $icon = $options['icon'];
        unset($options['url'], $options['icon']);
        if ($icon) {
            $title = '<i class="' . $icon . '"></i> ' . '<span class="button-text">' . $title . '</span>';
            $options['escape'] = false;
        }

        return $this->Html->link($title, $url, $options);
    }
public function addButton(string $title = null, array $options = []): string
    {
        if (!$title) {
            $title = __d('ck_tools', 'add');
        }
        $options = Hash::merge([
            'url' => null,
            'icon' => 'fa fa-plus',
            'class' => 'btn btn-default btn-xs btn-add',
        ], $options);
        $url = $options['url'];
        if (!$url) {
            $url = ['action' => 'add'];
            $url = $this->augmentUrlByBackParam($url);
        }
        $icon = $options['icon'];
        unset($options['url'], $options['icon']);
        if ($icon) {
            $title = '<i class="' . $icon . '"></i> ' . '<span class="button-text">' . $title . '</span>';
            $options['escape'] = false;
        }

        return $this->Html->link($title, $url, $options);
    }
public function addButton ( string $ title = null , array $ options = [ ] ) : string { if ( ! $ title ) { $ title = __d ( 'ck_tools' , 'add' ) ; } $ options = Hash :: merge ( [ 'url' => null , 'icon' => 'fa fa-plus' , 'class' => 'btn btn-default btn-xs btn-add' , ] , $ options ) ; $ url = $ options [ 'url' ] ; if ( ! $ url ) { $ url = [ 'action' => 'add' ] ; $ url = $ this -> augmentUrlByBackParam ( $ url ) ; } $ icon = $ options [ 'icon' ] ; unset ( $ options [ 'url' ] , $ options [ 'icon' ] ) ; if ( $ icon ) { $ title = '<i class="' . $ icon . '"></i> ' . '<span class="button-text">' . $ title . '</span>' ; $ options [ 'escape' ] = false ; } return $ this -> Html -> link ( $ title , $ url , $ options ) ; }
Renders an add button

@param string $title   Link Caption
@param array  $options Additional Options
@return string
Renders an add button