1
0
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:
astaxie
2016-08-29 13:42:40 +08:00
committed by GitHub
parent 7283aead42
commit f280dab880
2 changed files with 2 additions and 4 deletions

View File

@@ -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--