Documentation ¶
Index ¶
- Variables
- type AjaxController
- type BaseController
- func (CTRL *BaseController) ConfigPage(page string)
- func (CTRL *BaseController) GetActiveAds() map[string]string
- func (CTRL *BaseController) GetBlocks() map[string]string
- func (CTRL *BaseController) GetCache()
- func (CTRL *BaseController) GetContent() string
- func (CTRL *BaseController) GetDB(db ...string) orm.Ormer
- func (CTRL *BaseController) GetModuleMenu() string
- type IndexController
- type ViewController
Constants ¶
This section is empty.
Variables ¶
View Source
var DetectUserAgent = func(ctx *context.Context) { deviceDetector := mobiledetect.NewMobileDetect(ctx.Request, nil) ctx.Request.ParseForm() device := "" if len(ctx.Request.Form["device_type"]) != 0 { device = ctx.Request.Form["device_type"][0] } if device == "" { device = ctx.Input.Cookie("Device-Type") } if device == "" { if deviceDetector.IsMobile() { device = "mobile" } if deviceDetector.IsTablet() { device = "tablet" } if device == "" { device = beego.AppConfig.String("DefaultDevice") if device == "" { device = "desktop" } } } ctx.Output.Cookie("Device-Type", device) ctx.Input.SetData("device_type", device) }
DetectUserAgent detects device type and set it into a cookie
Functions ¶
This section is empty.
Types ¶
type AjaxController ¶
type AjaxController struct {
BaseController
}
func (*AjaxController) GetImageUploadStatus ¶
func (CTRL *AjaxController) GetImageUploadStatus()
type BaseController ¶
type BaseController struct { beego.Controller // contains filtered or unexported fields }
BaseController Extendable
func (*BaseController) ConfigPage ¶
func (CTRL *BaseController) ConfigPage(page string)
ConfigPage receives template name and makes basic config to render it
func (*BaseController) GetActiveAds ¶
func (CTRL *BaseController) GetActiveAds() map[string]string
func (*BaseController) GetBlocks ¶
func (CTRL *BaseController) GetBlocks() map[string]string
func (*BaseController) GetCache ¶
func (CTRL *BaseController) GetCache()
GetCache set the cache connector into our controller
func (*BaseController) GetContent ¶
func (CTRL *BaseController) GetContent() string
GetContent gets contents
func (*BaseController) GetDB ¶
func (CTRL *BaseController) GetDB(db ...string) orm.Ormer
GetDB set the orm connector into our controller if repication activated we use slave to Slave
func (*BaseController) GetModuleMenu ¶
func (CTRL *BaseController) GetModuleMenu() string
GetModuleMenu retrieves menu
type IndexController ¶
type IndexController struct {
BaseController
}
func (*IndexController) GetPage ¶
func (CTRL *IndexController) GetPage()
type ViewController ¶
type ViewController struct {
BaseController
}
ArticleController ...
func (*ViewController) Video ¶
func (CTRL *ViewController) Video()
Click to show internal directories.
Click to hide internal directories.