summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--group.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/group.go b/group.go
index 7cb56ad..06370eb 100644
--- a/group.go
+++ b/group.go
@@ -18,6 +18,17 @@ func (e *Engine) Group(prefix string, fn func(*Group)) {
fn(g)
}
+// Group.Group creates a nested Group
+// joining all prefixes of parent groups
+func(g *Group) Group(prefix string, fn func(*Group)) {
+ nested := &Group {
+ prefix: joinPath(g.prefix, prefix),
+ engine: g.engine,
+ }
+
+ fn(nested)
+}
+
/* Inherit Engine methods */
func (g *Group) GET(path string, handler Handler) {