我想使用Zend 1.12
中的查询字符串创建重定向。可选参数应采用查询字符串的形式。
这是我的代码:
if ($this->_request->getParam('partner')){
$controller = $this->getRequest()->getControllerName();
$action = $this->getRequest()->getActionName();
$module = $this->getRequest()->getModuleName();
$params = array(
"utm_source" => "affiliate",
"utm_medium" => "cpa",
"utm_term" => $this->_request->getParam('partner'),
"utm_campaign" => "partners",
"url" => $this->_request->getParam('url')
);¬
$this->_helper->redirector($action, $controller, $module, $params);
return false;
}
}
这会产生类似
的网址/content/agb/utm_source/affiliate/utm_medium/cpa/utm_term/foo
但我希望这看起来像:
/content/agb?utm_source=affiliate&utm_medium=cpa&utm_term=foo
我怎么能这样做?
谢谢!
答案 0 :(得分:1)
我自己构建网址并使用gotoUrlAndExit()
$this->_helper->redirector->gotoUrlAndExit('place?thing=value');