src/Controller/Component/FilterComponent.php
public function prg($table, $options = [])
    {
        $this->config($options);

        $formName = $this->_initParam('formName', $this->config('formName'));
        $action = $this->_initParam('action', $this->controller()->request->params['action']);

        $this->parameters()->config([
            'formName' => $formName,
        ]);
        if ($this->_controller->request->is(['post', 'put'])) {
            $this->_redirect($action);
        } elseif ($this->_controller->request->is('get')) {
            $this->_setViewData($formName);

            return $table->find('filters', $this->values());
        }

        return $table;
    }
public function prg($table, $options = [])
    {
        $this->config($options);

        $formName = $this->_initParam('formName', $this->config('formName'));
        $action = $this->_initParam('action', $this->controller()->request->params['action']);

        $this->parameters()->config([
            'formName' => $formName,
        ]);
        if ($this->_controller->request->is(['post', 'put'])) {
            $this->_redirect($action);
        } elseif ($this->_controller->request->is('get')) {
            $this->_setViewData($formName);

            return $table->find('filters', $this->values());
        }

        return $table;
    }
public function prg ( $ table , $ options = [ ] ) { $ this -> config ( $ options ) ; $ formName = $ this -> _initParam ( 'formName' , $ this -> config ( 'formName' ) ) ; $ action = $ this -> _initParam ( 'action' , $ this -> controller ( ) -> request -> params [ 'action' ] ) ; $ this -> parameters ( ) -> config ( [ 'formName' => $ formName , ] ) ; if ( $ this -> _controller -> request -> is ( [ 'post' , 'put' ] ) ) { $ this -> _redirect ( $ action ) ; } elseif ( $ this -> _controller -> request -> is ( 'get' ) ) { $ this -> _setViewData ( $ formName ) ; return $ table -> find ( 'filters' , $ this -> values ( ) ) ; } return $ table ; }
Implements Post Redirect Get flow method.
For POST requests builds redirection url and perform redirect to get action.
For GET requests add filters finder to passed into the method query and returns it.

@param Table $table Table instance.
@param array $options Search parameters.
@return mixed
Implements Post Redirect Get flow method . For POST requests builds redirection url and perform redirect to get action . For GET requests add filters finder to passed into the method query and returns it .