Codeigniter Pagination 类限制
我是 Codeigniter 的新手,我在分页类方面遇到了麻烦。
来自CI文档:(我确实仔细研究了它并练习了它。)
$this->load->library('pagination');
$config['base_url'] = 'http://example.com/index.php/test/page/';
$config['total_rows'] = '200';
$config['per_page'] = '20';
$this->pagination->initialize($config);
echo $this->pagination->create_links();
当我在本地主机上练习时,它效果很好。
如何为 base_url
值传递更多参数?
假设我必须将 mypara 传递给 page 函数,如下所示。
$config['base_url'] = 'http://example.com/index.php/test/page/mypara/';
那就不行了。如何在 base_url 中加入我的参数 (mypara)?
似乎不支持向base_url传递参数。
I am new to Codeigniter, and I have trouble with the pagination class.
From CI document: (I do studied it carefully and practiced it.)
$this->load->library('pagination');
$config['base_url'] = 'http://example.com/index.php/test/page/';
$config['total_rows'] = '200';
$config['per_page'] = '20';
$this->pagination->initialize($config);
echo $this->pagination->create_links();
It works quite well, when I do practice at local host.
How can I pass more parameters for the base_url
value?
Assumed I must pass mypara to page function as below.
$config['base_url'] = 'http://example.com/index.php/test/page/mypara/';
It doesn't work then. How can I joined my parameter (mypara) in the base_url?
It seems it doesn't support passing parameters to base_url.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是 codeigniter 论坛上的答案。 http://codeigniter.com/forums/viewthread/143280/P15T 这里有很多问题那里已经得到了答案。
Here's the answer on codeigniter forum. http://codeigniter.com/forums/viewthread/143280/P15T here are many questions that have been answered in there.
这是来自 Nettuts 的关于使用 COdeigniter 进行分页的优秀教程
http ://net.tutsplus.com/articles/news/codeigniter-from-scratch-day-7-pagination/
您也可以将其更改
为 3 或 4
Here is an excellent tutorial from Nettuts on Pagination with COdeigniter
http://net.tutsplus.com/articles/news/codeigniter-from-scratch-day-7-pagination/
You might also change this
to 3 or 4