ZF2: using url helper and reuse query parameters

前端 未结 2 600
北荒
北荒 2021-01-23 22:45

I\'m trying to reuse query params using Url helper in a view. This is my current url:

http://localhost/events/index?__orderby=name&__order=asc
2条回答
  •  清歌不尽
    2021-01-23 23:50

    You could use something like this, but the query parameters arent reused in my case.

    $this->url(
        'page/query',
        array(),
        array(
            'query' => array(
                'name'=>'my-test-page',
                'format' => 'rss',
                'limit' => 10,
            )
        ),
        true
    );
    

    So if you want to reuse query parameters you coul merge them with your new ones and then add all of them to the query array (3 parameter).

提交回复
热议问题