在搜索功能里搜索用户。 然后分页。在第一页的路径是/weibo/index.php/Search/sechUser?keyword=ad 点击第二页的时候变成/weibo/index.php/Search/sechUser/keyword/ad/p/2。
点击之后可是并不跳转页面。
这是php代码 public function sechUser(){
$keyword=$this->_getKeyword();//_getKeyword()是返回关键字的函数
if($keyword){
//检索出除自己外昵称含有关键字的用户
$where=array(
'username'=>array('LIKE','%'.$keyword.'%'),
'uid'=>array('NEQ',session('uid'))
);
$field=array('username','sex','location','info','face80','follow','fans','weibo','uid');
$db=M('userinfo');
import('ORG.Util.Page');// 导入分页类
$count=$db->where($where)->count('id');
$page=new Page($count,1);
$limit=$page->firstRow.','.$page->listRows;
$result=$db->where($where)->field($field)->limit($limit)->select();
//重新组合结果集 得到是否已关注与是否互相关注
$result=$this->_getMutual($result);
//分配搜索结果到视图
$this->result=$result? $result:false;
//页码
$this->page=$page->show();
//p($result);die;
}
$this->keyword=$keyword;
$this->display();
}
我在配置里设置了路由模式'URL_MODEL' => 1,可是第二页的路由不能变为/weibo/index.php/Search/sechUser?keyword=ad&&p=2,这个怎么解决????