views:

252

answers:

1

Hi ,

Trying to grab the params after ?. I need them to add to the Zend_Paginator. ex: http://www.example.com/test/show?name=xxx&age=20&sex=m Building a paginator for search results. Is there any solution for that ?

$router = new Zend_Controller_Router_Route_Regex(
            'test/show\?(.*)',       
            array(
                'controller' => 'test',
                'action'    => 'show',
                'module'    => 'user'
            ),
            array(
                1 => 'q'           
            ),
            'test/show%s'   
        );

        $router_prev->addRoute('view',$router);
A: 

Have you tried using the following in the controller?

$this->_request->getParams();

.. or just use the server variable for the query string:

$_SERVER['QUERY_STRING']
Cez
I've updated my answer with the simplest method if you want it as you have stated in your comment.
Cez