src/Controller/Component/AppComponent.php
public function redirect(array $options = [])
    {
        $plugin     = $this->_request->getParam('plugin');
        $controller = $this->_request->getParam('controller');

        $_options = [
            'apply'   => [],
            'savenew' => [
                'plugin'     => $plugin,
                'controller' => $controller,
                'action'     => 'add'
            ],
            'save' => [
                'plugin'     => $plugin,
                'controller' => $controller,
                'action'     => 'index',
            ]
        ];

        $options = Hash::merge($_options, $options);

        $url = $options['save'];
        if ($rAction = $this->_request->getData('action')) {
            list(, $action) = pluginSplit($rAction);
            $action = Str::low($action);
            if (Arr::key($action, $options)) {
                $url = $options[$action];
            }
        }

        return $this->_controller->redirect($url);
    }
public function redirect(array $options = [])
    {
        $plugin     = $this->_request->getParam('plugin');
        $controller = $this->_request->getParam('controller');

        $_options = [
            'apply'   => [],
            'savenew' => [
                'plugin'     => $plugin,
                'controller' => $controller,
                'action'     => 'add'
            ],
            'save' => [
                'plugin'     => $plugin,
                'controller' => $controller,
                'action'     => 'index',
            ]
        ];

        $options = Hash::merge($_options, $options);

        $url = $options['save'];
        if ($rAction = $this->_request->getData('action')) {
            list(, $action) = pluginSplit($rAction);
            $action = Str::low($action);
            if (Arr::key($action, $options)) {
                $url = $options[$action];
            }
        }

        return $this->_controller->redirect($url);
    }
public function redirect ( array $ options = [ ] ) { $ plugin = $ this -> _request -> getParam ( 'plugin' ) ; $ controller = $ this -> _request -> getParam ( 'controller' ) ; $ _options = [ 'apply' => [ ] , 'savenew' => [ 'plugin' => $ plugin , 'controller' => $ controller , 'action' => 'add' ] , 'save' => [ 'plugin' => $ plugin , 'controller' => $ controller , 'action' => 'index' , ] ] ; $ options = Hash :: merge ( $ _options , $ options ) ; $ url = $ options [ 'save' ] ; if ( $ rAction = $ this -> _request -> getData ( 'action' ) ) { list ( , $ action ) = pluginSplit ( $ rAction ) ; $ action = Str :: low ( $ action ) ; if ( Arr :: key ( $ action , $ options ) ) { $ url = $ options [ $ action ] ; } } return $ this -> _controller -> redirect ( $ url ) ; }
Redirect by request data.

@param   array $options
@return  \Cake\Http\Response|null
Redirect by request data .