当前位置: 动力学知识库 > 问答 > 编程问答 >

php - Send value by codeigniter pagination

问题描述:

How can I send value by pagination link in codeigniter?

If a category value equl 3 when I press any pagination link send 3 to the goal page.

for example like this :

$cate=3;

<a href ="goalpage.php?cate=$cate> linktext </a>

网友答案:

Configure Codeigniter pagination's setting like below:

$this->load->library('pagination');
$this->pagination->page_query_string = FALSE;
$this->pagination->query_string_segment = 'cate';
......
$this->pagination->create_links(...parameters of yours...);

After you set these two preferences the logic in Pagination class method create_link will get cate from $_GET and set it as Pagination::cur_page value and make the correct link to your goal page.

I just describe how to make Codeigniter's Pagination lib receive current page from your http query string, and the other work are associated to your program's specific occasion.

分享给朋友:
您可能感兴趣的文章:
随机阅读: