1
我有一个get方法的窗体。提交查询字符串后出现在url中?标记。但我希望它可以像Zend的URLZend ::更改从控制器/操作获取参数?param =值到控制器/操作/参数/值
来源: 控制器/动作PARAM =值 到: 控制器/动作/参数/值
我应该使用JavaScript重定向? 或者创建一个辅助函数zend来完成这项工作? 有没有更好的解决方案?
干杯
我有一个get方法的窗体。提交查询字符串后出现在url中?标记。但我希望它可以像Zend的URLZend ::更改从控制器/操作获取参数?param =值到控制器/操作/参数/值
来源: 控制器/动作PARAM =值 到: 控制器/动作/参数/值
我应该使用JavaScript重定向? 或者创建一个辅助函数zend来完成这项工作? 有没有更好的解决方案?
干杯
这取决于你的行动。 假设你的表单动作就像是'somecontroller/test'
Public function testAction(){
//codes
//You must be redirecting like this
$this->_redirect('/anothercontroller/fooaction?param=value');
//You can change that to
$this->_redirect('/anothercontroller/fooaction/param/value');
}
这样你可以得到价值在fooaction
$this->_request->getParam('param');
谢谢你的答案,但它不是我所需要的。在提交表单我得到的网址与参数?标记。我想要的是zend like url:controller/action/param/value not controller/action?param = value – ZendMind