how can send variable value through pagination links?
I was trying to create pagination based on the home page.
my default controller :
$route['default_controller'] ="home";
for pagination if I write-
$config['base_url'] = base_url() . 'home/index'; // index function
$config['uri_segment'] = 3;
$config['per_page'] = 10;
$limit = array($config['per_page'] => $this->uri->segment(3));
then it works but it shows 'localhost/baseurl/home/index/10' on browser
address bar.I want to show just 'localhost/baseurl/10' (while
'localhost/baseurl/' is my homepage and I want pagination on there).so I
wrote
$config['base_url'] = base_url(); // index function
$config['uri_segment'] = 1;
$config['per_page'] = 10;
$limitt = array($config['per_page'] => $this->uri->segment(1));
but that doesn't work. how can I do that ?
problem 2:
how can I send a variable value through pagination link like
localhost/baseurl/home/index?search=y/10
I wrote:
$config['base_url'] = base_url() . 'home/index?search=y';
but this doesn't work. it receives 'search=y/10'. not only 'y' and the
pagination doesn't find '10' on '$this->uri->segment(3))'
so whats the correct way to do that ?
-thanks.
No comments:
Post a Comment