• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why CI4 docs does not touch pagination class for Query Builder

I have work so deep loving ci4 with query builder but i find it hard to make pagination. 

While checked to docs it only explain how to use it with the Model no query builder explanation.

I try to use the Manual pagination and set offset in my query but not working properly instead of return the next paging it only return one result for the next paging and join it to the ckurent paging . am defiantly stuck here.

PHP Code:
$blog = new BlogModel();

                //* Retrieve blogs
                $total $blog->getActiveBlogTotal();

                $segment route_to('adminBlogPost''active');
                if($this->request->uri->getTotalSegments() == 4)
                    $page $this->request->uri->getSegment(4);
                    $page 1;
                $perPage 5;
                $pages $pager->makeLinks($page$perPage$total'admin_pag'5);

                $blogs $blog->getActiveBlogsInAdmin($page);
                return $this->smarty->view('blog/active.tpl'compact(

My model:
PHP Code:
//* Get blog in admin
    public function getActiveBlogsInAdmin($page)
        $table->join('zd_main_cats''zd_main_cats.main_cat_id = zd_blogs.blog_main_cat''left');
        $table->join('zd_users''zd_users.user_id = zd_blogs.blog_user''left');
        $query $table->get();
        if($table->countAllResults() > 0)
            return $query->getResult();
            return FALSE;

I will really appreciate if some one can be kind enough to give me a clear through

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.