$this->分页->create_links();返回空白字符串
<?php
class Books extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->helper('url');
}
function index() {
// load pagination class
$this->load->library('pagination');
$config['base_url'] = base_url().'books/index/';
$config['total_rows'] = 2;
$config['per_page'] = '5';
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$this->pagination->initialize($config);
echo $this->pagination->create_links();
}
}
?>
create_links();功能似乎不起作用。我没有收到任何错误,但它只返回一个空白字符串。我已经尝试过 http://blip.tv/nettuts/codeigniter- from-scratch-day-7-2690301 和 http://godbit.com /article/pagination-with-code-igniter 教程。
块引用
<?php
class Books extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->helper('url');
}
function index() {
// load pagination class
$this->load->library('pagination');
$config['base_url'] = base_url().'books/index/';
$config['total_rows'] = 2;
$config['per_page'] = '5';
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$this->pagination->initialize($config);
echo $this->pagination->create_links();
}
}
?>
The create_links(); function seems to not be working. I don't get any errors, but it just returns a blank string. I've tried both http://blip.tv/nettuts/codeigniter-from-scratch-day-7-2690301 and http://godbit.com/article/pagination-with-code-igniter tutorials.
I'm aware the documentation says http://codeigniter.com/user_guide/libraries/pagination.html The create_links() function returns an empty string when there is no pagination to show.
but so how do I fix that?
Thanks you!
Blockquote
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想是因为你没有任何分页数据。这是一个有效的示例:
我希望这会对您有所帮助
I think because you don't have any data for pagination. This is a working example:
I hope this will help you