【发布时间】:2011-05-22 04:22:59
【问题描述】:
<?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 教程我都试过了。
我知道文档说 http://codeigniter.com/user_guide/libraries/pagination.html The create_links() function returns an empty string when there is no pagination to show. 但是我该如何解决呢?
谢谢你!
块引用
【问题讨论】:
标签: php codeigniter pagination