开发者

Zend Router Route Regex with Search params

开发者 https://www.devze.com 2022-12-29 02:00 出处:网络
Trying to grab the params afte开发者_如何学Cr ?. I need them to add to the Zend_Paginator. ex: http://www.example.com/test/show?name=xxx&age=20&sex=m

Trying to grab the params afte开发者_如何学Cr ?. 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);


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']
0

精彩评论

暂无评论...
验证码 换一张
取 消