public function backButton(string $title = null, $url = null, array $options = []): string
    {
        $options = Hash::merge([
            'icon' => 'arrow-left',
            'escape' => false,
        ], $options);

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

        $here = $this->getRequestedAction();
        if ($this->request->getSession()->check('back_action.' . $here)) {
            $url = $this->request->getSession()->read('back_action.' . $here);
        }
        if (empty($url)) {
            $url = [
                'action' => 'index',
            ];
        }

        return $this->button($title, $url, $options);
    }
public function backButton(string $title = null, $url = null, array $options = []): string
    {
        $options = Hash::merge([
            'icon' => 'arrow-left',
            'escape' => false,
        ], $options);

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

        $here = $this->getRequestedAction();
        if ($this->request->getSession()->check('back_action.' . $here)) {
            $url = $this->request->getSession()->read('back_action.' . $here);
        }
        if (empty($url)) {
            $url = [
                'action' => 'index',
            ];
        }

        return $this->button($title, $url, $options);
    }
public function backButton ( string $ title = null , $ url = null , array $ options = [ ] ) : string { $ options = Hash :: merge ( [ 'icon' => 'arrow-left' , 'escape' => false , ] , $ options ) ; if ( ! $ title ) { $ title = '<span class="button-text">' . __d ( 'ck_tools' , 'Back' ) . '</span>' ; } $ here = $ this -> getRequestedAction ( ) ; if ( $ this -> request -> getSession ( ) -> check ( 'back_action.' . $ here ) ) { $ url = $ this -> request -> getSession ( ) -> read ( 'back_action.' . $ here ) ; } if ( empty ( $ url ) ) { $ url = [ 'action' => 'index' , ] ; } return $ this -> button ( $ title , $ url , $ options ) ; }
Renders a back button using the back actions within the session

@param string       $title   button caption
@param string|array $url     url to link to
@param array        $options link() config
@return string
Renders a back button using the back actions within the session