public function getPage( $pager, $form ) {
        $showResults = false;

        if ($this->getRequest()->isMethod("POST")) {
            $form->handleRequest( $this->getRequest() );

            if ( $form->isValid() )
            {
                $pager->setCurrentPage( $this->getRequest()->get( 'page', 1 ) );
                $showResults = true;
            }

        } else {
            $data = $this->getRequest()->query->all();
            if (array_key_exists($form->getName(), $data))
            {

                $form->setData($data[$form->getName()]);

                if (is_numeric($this->getRequest()->query->get("page")))
                {
                    $pager->setCurrentPage( $this->getRequest()->get( 'page', $this->getRequest()->query->get("page") ) );
                    $showResults = true;
                }
            }
        }

        return $showResults;
    }
public function getPage( $pager, $form ) {
        $showResults = false;

        if ($this->getRequest()->isMethod("POST")) {
            $form->handleRequest( $this->getRequest() );

            if ( $form->isValid() )
            {
                $pager->setCurrentPage( $this->getRequest()->get( 'page', 1 ) );
                $showResults = true;
            }

        } else {
            $data = $this->getRequest()->query->all();
            if (array_key_exists($form->getName(), $data))
            {

                $form->setData($data[$form->getName()]);

                if (is_numeric($this->getRequest()->query->get("page")))
                {
                    $pager->setCurrentPage( $this->getRequest()->get( 'page', $this->getRequest()->query->get("page") ) );
                    $showResults = true;
                }
            }
        }

        return $showResults;
    }
public function getPage ( $ pager , $ form ) { $ showResults = false ; if ( $ this -> getRequest ( ) -> isMethod ( "POST" ) ) { $ form -> handleRequest ( $ this -> getRequest ( ) ) ; if ( $ form -> isValid ( ) ) { $ pager -> setCurrentPage ( $ this -> getRequest ( ) -> get ( 'page' , 1 ) ) ; $ showResults = true ; } } else { $ data = $ this -> getRequest ( ) -> query -> all ( ) ; if ( array_key_exists ( $ form -> getName ( ) , $ data ) ) { $ form -> setData ( $ data [ $ form -> getName ( ) ] ) ; if ( is_numeric ( $ this -> getRequest ( ) -> query -> get ( "page" ) ) ) { $ pager -> setCurrentPage ( $ this -> getRequest ( ) -> get ( 'page' , $ this -> getRequest ( ) -> query -> get ( "page" ) ) ) ; $ showResults = true ; } } } return $ showResults ; }
handles request, sets the page, gets data for the page, returns boolean to show or not the results
handles request sets the page gets data for the page returns boolean to show or not the results