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. H开发者_StackOverflowow can I joined my parameter (mypara) in the base_url?
It seems it doesn't support passing parameters to base_url.
Here's the answer on codeigniter forum. http://codeigniter.com/forums/viewthread/143280/P15T here are many questions that have been answered in there.
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
$config['uri_segment'] = '2';
to 3 or 4
精彩评论