Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion net/ghttp/ghttp_request_param_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ import (
// GetPage creates and returns the pagination object for given `totalSize` and `pageSize`.
// NOTE THAT the page parameter name from clients is constantly defined as gpage.DefaultPageName
// for simplification and convenience.
//
// Deprecated: wrap this pagination html content in business layer.
func (r *Request) GetPage(totalSize, pageSize int) *gpage.Page {
// It must have Router object attribute.
if r.Router == nil {
panic("Router object not found")
panic("router object not found")
}
var (
url = *r.URL
Expand Down
6 changes: 6 additions & 0 deletions util/gpage/gpage.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// You can obtain one at https://github.com/gogf/gf.

// Package gpage provides useful paging functionality for web pages.
//
// Deprecated: wrap this pagination html content in business layer.
package gpage

import (
Expand All @@ -18,6 +20,8 @@ import (

// Page is the pagination implementer.
// All the attributes are public, you can change them when necessary.
//
// Deprecated: wrap this pagination html content in business layer.
type Page struct {
TotalSize int // Total size.
TotalPage int // Total page, which is automatically calculated.
Expand Down Expand Up @@ -48,6 +52,8 @@ const (
// /user/list/{.page}, /user/list/{.page}.html, /user/list?page={.page}&type=1, etc.
// The build-in variable in `urlTemplate` "{.page}" specifies the page number, which will be replaced by certain
// page number when producing.
//
// Deprecated: wrap this pagination html content in business layer.
func New(totalSize, pageSize, currentPage int, urlTemplate string) *Page {
p := &Page{
LinkStyle: "GPageLink",
Expand Down
Loading