Welcome Guest, Not a member yet? Register   Sign In
Create_link() not genrating link properly if used in subfolder controller
#1

[eluser]vaibhav[/eluser]
Hello all,

I am facing one typical behavior of pagination link. i am using below test code in one of my root controller

$this->load->library('pagination');
$this->load->model("jobs",'obj');
$config['base_url'] = $this->config->site_url().'/test/viewdata';
$config['total_rows'] = $this->obj->getjobscount();
$config['per_page'] = 4;
$this->pagination->initialize($config);
echo $this->pagination->create_links();

In the above case i am getting links properly and able to moves forward and backward.

but when i shift this code to sub folder in controller like

$this->load->library('pagination');
$this->load->model("jobs",'obj');
$config['base_url'] = $this->config->site_url().'/admin/test/viewdata';
$config['total_rows'] = $this->obj->getjobscount();
$config['per_page'] = 4;
$this->pagination->initialize($config);
echo $this->pagination->create_links();

In this case i get links but not able to move forward when i click on links

Plz anybody knows solution for the same. its pagination class bug or mistake on my side.

Thanks
#2

[eluser]vaibhav[/eluser]
Hello all

I am amazed that i my question is still not been answered by forum... Is anyone who can help me out ????

Thanks
#3

[eluser]wiredesignz[/eluser]
Check your routes.
If it worked one time then it is mostly likely a problem with your application settings now.
#4

[eluser]vaibhav[/eluser]
hello wiredesignz,

Thx for idea.... Finally i found the reason for the same.

i have to use
$config['uri_segment'] = 4;

as pageno position is changed to 4th compare to default 3

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB