mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:00:54 +00:00
Fix paginator attributes cannot be modified bug
We can only use SetPaginator to create a pagination. After that, we always need to modify something, like the totalNum, perPageNum. These change should be seen in the view. So we should give the view a pointer than a object.
This commit is contained in:
parent
9c665afc04
commit
c52f634d9c
@ -21,6 +21,6 @@ import (
|
||||
// Instantiates a Paginator and assigns it to context.Input.Data["paginator"].
|
||||
func SetPaginator(context *context.Context, per int, nums int64) (paginator *Paginator) {
|
||||
paginator = NewPaginator(context.Request, per, nums)
|
||||
context.Input.Data["paginator"] = paginator
|
||||
context.Input.Data["paginator"] = &paginator
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user