也是费了很大的精力解决,当我们使用get方式时它会将r=控制器/方法名给覆盖掉,而导致 直接跳转到首页的问题。
在做搜索分页时表单get提交时他自动跳至首页,会把跳转地址给清除(覆盖)掉
像下面这样正常是
http://localhost/space/frontend/web/index.php?r=space-write/teacher&shop_id=87&div=1
结果却是
http://localhost/space/frontend/web/index.php?shop_id=87&div=1
解决办法也很简单,像这样在隐藏域里加入名字为 r 的就好了值为缺少的参数
<input type="hidden" name="r" value="space-write/teacher">