public function backToListButton($title = null, array $url = null, array $options = [])
    {
        if (empty($url)) {
            $url = [
                'action' => 'index'
            ];
        }
        $options = Hash::merge([
            'class' => 'btn btn-default btn-xs',
            'escape' => false,
            'additionalClasses' => null,
            'useReferer' => false
        ], $options);

        if (!empty($options['useReferer']) && $this->request->referer(true) != '/' && $this->request->referer(true) != $this->request->here) {
            $url = $this->request->referer(true);
        }

        if (!$title) {
            $title = '<span class="button-text">' . __d('list_filter', 'forms.back_to_list') . '</span>';
        }

        if ($options['additionalClasses']) {
            $options['class'] .= ' ' . $options['additionalClasses'];
        }

        if (empty($options['useReferer'])) {
            $url = $this->addListFilterParams($url);
        }
        $button = $this->Html->link('<i class="fa fa-arrow-left"></i> ' . $title, $url, $options);

        return $button;
    }
public function backToListButton($title = null, array $url = null, array $options = [])
    {
        if (empty($url)) {
            $url = [
                'action' => 'index'
            ];
        }
        $options = Hash::merge([
            'class' => 'btn btn-default btn-xs',
            'escape' => false,
            'additionalClasses' => null,
            'useReferer' => false
        ], $options);

        if (!empty($options['useReferer']) && $this->request->referer(true) != '/' && $this->request->referer(true) != $this->request->here) {
            $url = $this->request->referer(true);
        }

        if (!$title) {
            $title = '<span class="button-text">' . __d('list_filter', 'forms.back_to_list') . '</span>';
        }

        if ($options['additionalClasses']) {
            $options['class'] .= ' ' . $options['additionalClasses'];
        }

        if (empty($options['useReferer'])) {
            $url = $this->addListFilterParams($url);
        }
        $button = $this->Html->link('<i class="fa fa-arrow-left"></i> ' . $title, $url, $options);

        return $button;
    }
public function backToListButton ( $ title = null , array $ url = null , array $ options = [ ] ) { if ( empty ( $ url ) ) { $ url = [ 'action' => 'index' ] ; } $ options = Hash :: merge ( [ 'class' => 'btn btn-default btn-xs' , 'escape' => false , 'additionalClasses' => null , 'useReferer' => false ] , $ options ) ; if ( ! empty ( $ options [ 'useReferer' ] ) && $ this -> request -> referer ( true ) != '/' && $ this -> request -> referer ( true ) != $ this -> request -> here ) { $ url = $ this -> request -> referer ( true ) ; } if ( ! $ title ) { $ title = '<span class="button-text">' . __d ( 'list_filter' , 'forms.back_to_list' ) . '</span>' ; } if ( $ options [ 'additionalClasses' ] ) { $ options [ 'class' ] .= ' ' . $ options [ 'additionalClasses' ] ; } if ( empty ( $ options [ 'useReferer' ] ) ) { $ url = $ this -> addListFilterParams ( $ url ) ; } $ button = $ this -> Html -> link ( '<i class="fa fa-arrow-left"></i> ' . $ title , $ url , $ options ) ; return $ button ; }
Renders a back-to-list button using the ListFilter-relevant named params

@param string $title button caption
@param array $url url to link to
@param array $options link() config
@return string
Renders a back - to - list button using the ListFilter - relevant named params