mirror of
https://github.com/astaxie/beego.git
synced 2025-07-16 02:32:17 +00:00
Revert "route variables should not have underline"
This commit is contained in:
4
tree.go
4
tree.go
@@ -467,7 +467,7 @@ func splitPath(key string) []string {
|
||||
// ":name:string" -> true, [:name], ([\w]+)
|
||||
// ":id([0-9]+)" -> true, [:id], ([0-9]+)
|
||||
// ":id([0-9]+)_:name" -> true, [:id :name], ([0-9]+)_(.+)
|
||||
// "cms_:id_:page.html" -> true, [:id :page], cms_(.+)_(.+).html
|
||||
// "cms_:id_:page.html" -> true, [:id_ :page], cms_(.+)(.+).html
|
||||
// "cms_:id(.+)_:page.html" -> true, [:id :page], cms_(.+)_(.+).html
|
||||
// "*" -> true, [:splat], ""
|
||||
// "*.*" -> true,[. :path :ext], "" . meaning separator
|
||||
@@ -487,7 +487,7 @@ func splitSegment(key string) (bool, []string, string) {
|
||||
var expt []rune
|
||||
var skipnum int
|
||||
params := []string{}
|
||||
reg := regexp.MustCompile(`[a-zA-Z0-9]+`)
|
||||
reg := regexp.MustCompile(`[a-zA-Z0-9_]+`)
|
||||
for i, v := range key {
|
||||
if skipnum > 0 {
|
||||
skipnum--
|
||||
|
Reference in New Issue
Block a user