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:
@ -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)
|
||||
|
Reference in New Issue
Block a user