Welcome Guest, Not a member yet? Register   Sign In
About pagination
#1
Information 

I am using CI3 and the pagination is not working on the second page. Is that i am missing something? Here is my code from the controller:
PHP Code:
public function tags($task "list")
    {
        
$header['title'] = 'Tag List';
        
$this->load->view("template/header"$header);
        
$this->load->view("template/dashboardNavView");

        
$builder ['task'] = $task;

        if(
$task == "list" || $task == "")
        {

            
$pager['base_url'] = "/dashboard/tags/";
            
$pager['total_rows'] = $this->db->count_all('tags');
            
$pager['per_page'] = 4;
            
$pager["uri_segment"] = 3;
            
$this->pagination->initialize($pager);

            
$page $this->uri->segment(3);

            
$builder['tags'] = $this->db->order_by('id''DESC')->limit($pager['per_page'], $page)->get('tags')->result();
            
$builder['pager'] = $this->pagination->create_links();

        }

        
$this->load->view("tags/TagsBuilderView"$builder);
        
$this->load->view("template/footer");
    } 

Everything seems ok, but when i click on the second link then empty view returned.
Reply


Messages In This Thread
About pagination - by rakibtg - 02-07-2015, 01:47 AM
RE: About pagination - by Rufnex - 02-07-2015, 04:51 AM
RE: About pagination - by rakibtg - 02-07-2015, 05:32 AM
RE: About pagination - by Rufnex - 02-07-2015, 06:57 AM
RE: About pagination - by rakibtg - 02-07-2015, 08:09 AM
RE: About pagination - by Rufnex - 02-07-2015, 10:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB