Zend url : get parameter always stay in the url

后端 未结 2 1008
陌清茗
陌清茗 2021-01-28 02:49

I have some trouble using the Zend url helper with get parameter. In a view, I have pagination which send extra parameters in get (so in the url), so that\'s ok. But that is not

相关标签:
2条回答
  • 2021-01-28 03:25

    The url method accepts additional parameters. One of them resets the get-string parameters.

    url (

    array $ urlOptions = array(),
    $ name = null,
    $ reset = false,
    $ encode = true
    )
    Generates an url given the name of a route.

    Parameters:

    array $urlOptions - Options passed to the assemble method of the Route object.
    mixed $name - The name of a Route to use. If null it will use the current Route
    bool $reset - Whether or not to reset the route defaults with those provided

    Returns: string Url for the link href attribute.

    It's all in the doc. The above is for ZF version 1.10

    0 讨论(0)
  • 2021-01-28 03:30

    The definition or url() is

    public function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
    

    So try setting the third parameter ($reset) to true

    0 讨论(0)
提交回复
热议问题