CI 的 分页 跳转问题
求教大神,谢谢~~搞了好久不知道错在哪我的目录为http://localhost/CI
控制器地址为“http://localhost/CI/index.php/page/pagelist”
page为控制器,pagelist为函数
然后运行时第一个页面OK的
如下:
12 3 4》 last
然后当我点2的时候出现错误,我查看了下点击后的地址
变成http://localhost/index.php/page/pagelist/5
后面的数字5暂且不管,但为什么地址转向没CI目录了呢
控制器代码如下,代码应该没问题 是按教程抄写的,就是不知道哪里需要设置下
class Page extends CI_Controller {
function pagelist(){
$this->load->model('usermod');
$user=$this->usermod->user_select_all();
$pageall=count($user);
$pagenum=5;
$config['total_rows']=$pageall;
$config['per_page']=$pagenum;
$config['num_links']=3;
$config['base_url']=base_url()."/index.php/page/pagelist";
//这一行我试验了很多地址 /index.php/page/pagelist ; localhost/CI/index.php/page/pagelist 等都不行
$config['use_page_numbers']=true;
$this->load->library("pagination");
$this->pagination->initialize($config);
echo $this->pagination->create_links();
echo '<br />';
config.php 的 base_url 设置有问题吧 Hex 发表于 2013-4-17 18:58 static/image/common/back.gif
config.php 的 base_url 设置有问题吧
谢谢 这个设置过都不行
比如localhost
localhost/CI
localhost/CI/index.php
逸笑沧海 发表于 2013-4-17 19:46 static/image/common/back.gif
谢谢 这个设置过都不行
比如localhost
localhost/CI
要设置成 http://xxxx.com/ 这样的形式 http://codeigniter.org.cn/forums/thread-19402-1-1.html这里有完美答案
页:
[1]