1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-04 13:10:19 +00:00

Remove PaginationController interface and pass context instead. Refs #835.

This commit is contained in:
Jens Bissinger
2014-10-08 15:59:26 +02:00
parent 0b3763cc67
commit 262665f4e5
3 changed files with 5 additions and 20 deletions

View File

@ -18,7 +18,7 @@ In your beego.Controller:
func (this *PostsController) ListAllPosts() {
// sets this.Data["paginator"] with the current offset (from the url query param)
postsPerPage := 20
paginator := pagination.SetPaginator(this, postsPerPage, CountPosts())
paginator := pagination.SetPaginator(this.Ctx, postsPerPage, CountPosts())
// fetch the next 20 posts
this.Data["posts"] = ListPostsByOffsetAndLimit(paginator.Offset(), postsPerPage)