Php 第4段如何在codeigniter中分页
在codeigniter(3版)上开发站点时,出现了一个错误:分页无法正常工作。只有在第四个URL段设置分页时,才会发生这种情况 我的控制器(课堂主控)Php 第4段如何在codeigniter中分页,php,codeigniter,codeigniter-3,Php,Codeigniter,Codeigniter 3,在codeigniter(3版)上开发站点时,出现了一个错误:分页无法正常工作。只有在第四个URL段设置分页时,才会发生这种情况 我的控制器(课堂主控) 链接类似于工作,但只突出显示了第一页。在第二页和后续页上,第一页也会突出显示。只需告诉它使用第四段 $config['uri_segment'] = 4; 这是中显示的第一个选项。我遇到了相同的问题,但我解决了它,并且工作正常: //u need to get the category id from the segment #3 $cati
链接类似于工作,但只突出显示了第一页。在第二页和后续页上,第一页也会突出显示。只需告诉它使用第四段
$config['uri_segment'] = 4;
这是中显示的第一个选项。我遇到了相同的问题,但我解决了它,并且工作正常:
//u need to get the category id from the segment #3
$catid = $this->uri->segment(3);
//here is the segment of pagintation
$config["uri_segment"] = 4;
/*
here is the essantial work, where you should add the category id in the last of the base url
*/
$config["base_url"] = base_url() . "home/category/$catid";
当你通过第四个uri段时,你能给我url吗?好的,给我本地url,你不明白。我的计算机(本地服务器)中的文件是的,我理解。但是我想知道您是如何传递第四个URI的,您是否在routes.php中为第四个URI路由了方法?我已经厌倦了设置路由和其他东西。这一次节省了我的时间。谢谢兄弟。它工作得很好。
//u need to get the category id from the segment #3
$catid = $this->uri->segment(3);
//here is the segment of pagintation
$config["uri_segment"] = 4;
/*
here is the essantial work, where you should add the category id in the last of the base url
*/
$config["base_url"] = base_url() . "home/category/$catid";