Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
problem with pagination
  • Suggest why this action displayed immediately as the last page of the sample pagination:
    public function action_two($id){
            $this->template->title = 'Каталог запчастей';
            $query = Model_Catalog::query()->where('parent1', $id);
            $config = array(
                'pagination_url' => \Fuel\Core\Uri::base(false).'catalog/two',            
                'total_items'    => $query->count(),
                'per_page'       => 30,
                'uri_segment'    => 3,
                'num_links' => 3,
                'show_first' => true,
                'show_last' => true,
            );
            $pagination = Pagination::forge('mypagination', $config);
            $data['catalog'] = Model_Catalog::query()                            
                                ->rows_offset($pagination->offset)
                                ->rows_limit($pagination->per_page)
                                ->where('parent1',$id)
                                ->get();
            $data['pagination'] = $pagination;
            $data['category'] = Model_Catalog::query()->where('lever',2)->where('parent1',$id)->get();
            $this->template->content = \Fuel\Core\View::forge('public/two',$data);
        }
  • sorry figured it was necessary to add another segment pagination_url

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion