1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-19 10:57:05 +00:00

New mvc.IgnoreEmbedded option to solve #2103

This commit is contained in:
Gerasimos (Makis) Maropoulos
2023-03-19 16:31:14 +02:00
parent 0954986a66
commit 34387a4a5c
6 changed files with 135 additions and 3 deletions

View File

@@ -196,6 +196,13 @@ func (opt OptionFunc) Apply(c *ControllerActivator) {
opt(c)
}
// IgnoreEmbedded is an Option which can be used to ignore all embedded struct's method handlers.
//
// For global affect, set the `IgnoreEmbeddedControllers` package-level variable to true.
var IgnoreEmbedded OptionFunc = func(c *ControllerActivator) {
c.SkipEmbeddedMethods()
}
// Handle serves a controller for the current mvc application's Router.
// It accept any custom struct which its functions will be transformed
// to routes.