代码之家  ›  专栏  ›  技术社区  ›  Andrew

Zend Framework:如何从URL中删除请求参数?

  •  1
  • Andrew  · 技术社区  · 15 年前

    我试过这样做,但没有成功:

    $params = $this->_getAllParams();
    
    if (!empty($params['active-tab'])) {
        //do something with $params['active-tab'] before removing it
        //then...
        unset($params['active-tab']);
        $this->_request->setParams($params);
    }
    

    我想Zendèu的请求并不像我想的那样有效。下面是我想出的解决方案:

    $params = $this->_getAllParams();
    
    if (!empty($params['active-tab'])) {
        //do something with $params['active-tab'] before removing it
        unset($params['active-tab']);
        $this->_helper->redirector($params['action'], $params['controller'], $params['module'], $params);
    }
    
    2 回复  |  直到 15 年前
        1
  •  3
  •   Joe Martinez    15 年前

    你不能像那样改变浏览器地址栏里的内容。url仅在从一个页面转到下一个页面时更改。除非我误解了你的问题。

        2
  •  0
  •   Iznogood    15 年前