Does beego have a way to create multi-level controllers?

such as admin/userController index/userController in php framework

how to create it in beego? I haven"t found any documents and instructions similar to this writing method for a long time

Mar.11,2022

Yes. Beego routing parses the request to a function. As long as this function implements the FilterFunc func (* context.Context) interface, you can put your controller logic anywhere


.

package routers

import (

)
"github.com/astaxie/beego"
"web/controllers"
"web/controllers/index"

)

func init () {

beego.Router("/", &controllers.MainController{}, "get:Index")
beego.Router("/index", &index.IndexController{},"get:Index")

}

Menu