Documentation ¶
Overview ¶
Package routers implemented controller methods of beego.
Index ¶
- type BaseRouter
- func (this *BaseRouter) CheckActiveRedirect(args ...interface{}) bool
- func (this *BaseRouter) CheckFlashRedirect(value string) (match bool, redirect bool)
- func (this *BaseRouter) CheckLoginRedirect(args ...interface{}) bool
- func (this *BaseRouter) CheckXsrfCookie() bool
- func (this *BaseRouter) EndFlashRedirect()
- func (this *BaseRouter) Finish()
- func (this *BaseRouter) FlashRead(key string) (string, bool)
- func (this *BaseRouter) FlashRedirect(uri string, code int, flag string, args ...interface{})
- func (this *BaseRouter) FlashWrite(key string, value string)
- func (this *BaseRouter) FormOnceCreate(args ...bool)
- func (this *BaseRouter) FormOnceNotMatch() bool
- func (this *BaseRouter) IsAjax() bool
- func (this *BaseRouter) JsStorage(action, key string, values ...string)
- func (this *BaseRouter) LoginUser(user *models.User, remember bool) string
- func (this *BaseRouter) Prepare()
- func (this *BaseRouter) SetFormError(form interface{}, fieldName, errMsg string, names ...string)
- func (this *BaseRouter) SetFormSets(form interface{}, names ...string) *utils.FormSets
- func (this *BaseRouter) SetPaginator(per int, nums int64) *utils.Paginator
- func (this *BaseRouter) SystemException()
- func (this *BaseRouter) ValidAppendFormSets(form interface{}, names ...string) bool
- func (this *BaseRouter) ValidForm(form interface{}, names ...string) bool
- func (this *BaseRouter) ValidFormSets(form interface{}, names ...string) bool
- type NestPreparer
- type RobotRouter
- type TestRouter
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) 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()