func (pg *Pager) PageItems() []*PagerItem {
	var items []*PagerItem
	for i := 1; i <= pg.Pages; i++ {
		item := &PagerItem{
			Page: i,
			Link: fmt.Sprintf(pg.layout, i),
		}
		items = append(items, item)
	}
	return items
}
PageItems returns each page item in this pager
package helper
import "fmt"
type (
	PagerCursor struct {
		all   int
		size  int
		pages int
	}
	Pager struct {
		Begin   int
		End     int
		Prev    int
		Next    int
		Current int
		Pages   int
		All     int
		layout string
	}
	PagerItem struct {
		Page int
		Link string
	}
)
func NewPagerCursor(size, all int) *PagerCursor {
	pc := &PagerCursor{
		all:  all,
		size: size,
	}
	if all%size == 0 {
		pc.pages = all / size
	} else {
		pc.pages = all/size + 1
	}
	return pc
}
func (pg *PagerCursor) Page(i int) *Pager {
	if i < 1 {
		return nil
	}
	begin := (i - 1) * pg.size
	if begin > pg.all {
		return nil  
	}
	pager := &Pager{
		Begin:   begin,
		Prev:    i - 1,
		Next:    i + 1,
		Current: i,
		Pages:   pg.pages,
		All:     pg.all,
	}
	end := begin + pg.size
	if end >= pg.all {
		end = pg.all
		pager.Next = 0  
	}
	pager.End = end
	return pager
}
func (pg *Pager) SetLayout(layout string) {
	pg.layout = layout
}
func (pg *Pager) PrevURL() string {
	if pg.Prev > 0 {
		return fmt.Sprintf(pg.layout, pg.Prev)
	}
	return ""
}
func (pg *Pager) NextURL() string {
	if pg.Next > 0 {
		return fmt.Sprintf(pg.layout, pg.Next)
	}
	return ""
}
func (pg *Pager) URL() string {
	return fmt.Sprintf(pg.layout, pg.Current)
}