|
楼主 |
发表于 2008-7-29 04:46:25
|
显示全部楼层
用了hex的方法, 在config.php 中,将‘uri_protocol’ 设置为 ‘PATH_INFO’.
$config['uri_protocol'] = "PATH_INFO";
然后修改分页类,Pagination.php
120行,注销掉
/*
$CI =& get_instance();
if ($CI->uri->segment($this->uri_segment) != 0)
{
$this->cur_page = $CI->uri->segment($this->uri_segment);
// Prep the current page - no funny business!
$this->cur_page = (int) $this->cur_page;
}
*/
然后修改160行
//$this->base_url = rtrim($this->base_url, '/') .'/';
$this->base_url = rtrim($this->base_url, '/'); //去掉分页类自己增加的“/”
然后在控制器里面将cur_page参数传入
parse_str($_SERVER['QUERY_STRING'],$_GET);
$key_g = isset($_GET["key"]) && !empty($_GET["key"]) ? $this->cleanInfo($_GET["key"]) : '';
$pid_g = isset($_GET["pid"]) && !empty($_GET["pid"]) ? $this->cleanInfo($_GET["pid"]) : 0;
$page_g = isset($_GET["p_count"]) && !empty($_GET["p_count"]) ? $_GET["p_count"] : 0;
$key = isset($_POST["key"]) && !empty($_POST["key"]) ? $this->cleanInfo($_POST["key"]) : $key_g;
$pid = isset($_POST["pid"]) && !empty($_POST["pid"]) ? $this->cleanInfo($_POST["pid"]) : $pid_g;
$page = isset($_POST["p_count"]) && !empty($_POST["p_count"]) ? $_POST["p_count"] : $page_g;
$config['base_url'] = site_url("/searchinfo/searchPerInfo/?key=".$key."&pid=".$bid."&p_count="); 设置分页链接为GET方式
$config['cur_page'] = $page; //不让分页类自己去取,直接传进去
是能把问题解决了,不过总是觉得有些别扭 |
|