From c52f634d9c83a307c0bac057507d009c92b074b9 Mon Sep 17 00:00:00 2001 From: Athurg Gooth Date: Thu, 11 Dec 2014 16:42:50 +0800 Subject: [PATCH] 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. --- utils/pagination/controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/pagination/controller.go b/utils/pagination/controller.go index 28473f8a..f63b30e9 100644 --- a/utils/pagination/controller.go +++ b/utils/pagination/controller.go @@ -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 }