2
votes

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.

2
re-read Customizing the Pagination and search the codeigniter.com forums, this question has been asked again - afarazit
found it, codeigniter.com/forums/viewthread/143280/P15 read codeigniter forums, there are many questions that have been answered in there. - afarazit
@atno, Thanks a lot. I will check it now. - Nano HE
He hey, if my answer was correct please mark it as such - afarazit

2 Answers

2
votes

Here's the answer on codeigniter forum. http://codeigniter.com/forums/viewthread/143280/P15T here are many questions that have been answered in there.

2
votes

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