page

package
v1.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pagination

type Pagination struct {
	// 当前页
	CurrentPage int
	// 最后一页
	LastPage int
	// 数据总数
	Total int
	// 每页数量
	ListRows int
	// 当前开始位置
	NowStart int
	// 是否有下一页
	HasMore bool
	// 链接
	UrlPath string
	// url中参数
	Parameters url.Values
	// 生成链接
	PageHtml string
}

分页

func New

func New() *Pagination

构造函数

func (*Pagination) Paginate

func (this *Pagination) Paginate(
	listRows int,
	total int,
	urlPath string,
	parameters url.Values,
) *Pagination

每页数量 listRows 每页数量 total 总数量, urlPath 链接, config 配置参数

page:当前页,
path:url路径,
query:url额外参数,
fragment:url锚点,

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL