This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hi my Pagination was working perfectly in BETA. Now, in RC i am getting an error "Paginator" class not found with the old code.
// Old code for Beta
App::make('paginator')->setCurrentPage($page);
$model->paginate($perPage);
// New code for RC
$model->paginate($perPage, $page);
I tried to implement new code but unable to understand how to use in my component. My code is like this :
$page = (intval($this->property('pageParam')) < 1 ? 1 : intval($this->property('pageParam')));
$num1 = $this->postsPerPage * ($page - 1); // skip first 100 rows
$num2 = $this->postsPerPage; // take only 2 rows
$posts = DB::select(DB::raw("SELECT *column FROM Table 1 Union Table 2 union Table3 ");
App::make('paginator')->setCurrentPage($page);
return Paginator::make($posts, $this->listAllPosts(), $this->postsPerPage);
Let me know how i will use with new code in RC like $model->paginate($perPage, $page); since, i am using $posts not $model.
Last updated
Ya i went through that doc. IT SAYS
// Old code for Beta
App::make('paginator')->setCurrentPage($page);
$model->paginate($perPage);
// New code for RC
$model->paginate($perPage, $page);
Now the question is how i will use // New code for RC which says simply to do like $model->paginate($perPage, $page);
Let me know how i will use with new code in RC like $model->paginate($perPage, $page); since, i am using $posts not $model.
$page = (intval($this->property('pageParam')) < 1 ? 1 : intval($this->property('pageParam')));
$num1 = $this->postsPerPage * ($page - 1); // skip first 100 rows
$num2 = $this->postsPerPage; // take only 2 rows
$posts = DB::select(DB::raw("SELECT *column FROM Table 1 Union Table 2 union Table3 ");
App::make('paginator')->setCurrentPage($page);
return Paginator::make($posts, $this->listAllPosts(), $this->postsPerPage);
Last updated
1-4 of 4