base

package
v0.0.0-...-a64d9b0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2020 License: GPL-3.0 Imports: 16 Imported by: 8

Documentation

Overview

Package routers implemented controller methods of beego.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRouter

type BaseRouter struct {
	beego.Controller
	i18n.Locale
	User     models.User
	IsLogin  bool
	IsMobile bool
	IsTablet bool
}

baseRouter implemented global settings for all other routers.

func (*BaseRouter) CheckActiveRedirect

func (this *BaseRouter) CheckActiveRedirect(args ...interface{}) bool

check if user not active then redirect

func (*BaseRouter) CheckFlashRedirect

func (this *BaseRouter) CheckFlashRedirect(value string) (match bool, redirect bool)

check flash redirect, ensure browser redirect to uri and display flash message.

func (*BaseRouter) CheckLoginRedirect

func (this *BaseRouter) CheckLoginRedirect(args ...interface{}) bool

check if not login then redirect

func (*BaseRouter) CheckXsrfCookie

func (this *BaseRouter) CheckXsrfCookie() bool

check xsrf and show a friendly page

func (*BaseRouter) EndFlashRedirect

func (this *BaseRouter) EndFlashRedirect()

clear flash redirect

func (*BaseRouter) Finish

func (this *BaseRouter) Finish()

on router finished

func (*BaseRouter) FlashRead

func (this *BaseRouter) FlashRead(key string) (string, bool)

read beego flash message

func (*BaseRouter) FlashRedirect

func (this *BaseRouter) FlashRedirect(uri string, code int, flag string, args ...interface{})

set flash redirect

func (*BaseRouter) FlashWrite

func (this *BaseRouter) FlashWrite(key string, value string)

write beego flash message

func (*BaseRouter) FormOnceCreate

func (this *BaseRouter) FormOnceCreate(args ...bool)

create form once html

func (*BaseRouter) FormOnceNotMatch

func (this *BaseRouter) FormOnceNotMatch() bool

check form once, void re-submit

func (*BaseRouter) IsAjax

func (this *BaseRouter) IsAjax() bool

func (*BaseRouter) JsStorage

func (this *BaseRouter) JsStorage(action, key string, values ...string)

func (*BaseRouter) LoginUser

func (this *BaseRouter) LoginUser(user *models.User, remember bool) string

func (*BaseRouter) Prepare

func (this *BaseRouter) Prepare()

Prepare implemented Prepare method for baseRouter.

func (*BaseRouter) SetFormError

func (this *BaseRouter) SetFormError(form interface{}, fieldName, errMsg string, names ...string)

add valid error to FormError

func (*BaseRouter) SetFormSets

func (this *BaseRouter) SetFormSets(form interface{}, names ...string) *utils.FormSets

func (*BaseRouter) SetPaginator

func (this *BaseRouter) SetPaginator(per int, nums int64) *utils.Paginator

func (*BaseRouter) SystemException

func (this *BaseRouter) SystemException()

func (*BaseRouter) ValidAppendFormSets

func (this *BaseRouter) ValidAppendFormSets(form interface{}, names ...string) bool

func (*BaseRouter) ValidForm

func (this *BaseRouter) ValidForm(form interface{}, names ...string) bool

valid form and put errors to tempalte context

func (*BaseRouter) ValidFormSets

func (this *BaseRouter) ValidFormSets(form interface{}, names ...string) bool

valid form and put errors to tempalte context

type NestPreparer

type NestPreparer interface {
	NestPrepare()
}

type RobotRouter

type RobotRouter struct {
	beego.Controller
}

RobotRouter implemented global settings for all other routers.

func (*RobotRouter) Get

func (this *RobotRouter) Get()

Get implemented Prepare method for RobotRouter.

type TestRouter

type TestRouter struct {
	BaseRouter
}

func (*TestRouter) Get

func (this *TestRouter) Get()

Jump to

Keyboard shortcuts

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