1
0
mirror of https://github.com/beego/bee.git synced 2025-07-05 18:20:18 +00:00

bee generate views

This commit is contained in:
astaxie
2014-08-11 10:01:56 +08:00
parent 270a52100c
commit 6abaa4368b
2 changed files with 60 additions and 2 deletions

13
g.go
View File

@ -33,8 +33,8 @@ bee generate migration [filename]
bee generate controller [controllerfile]
generate RESTFul controllers
bee generate router [controllerfile]
generate router based on controllerfile
bee generate view [viewpath]
generate CRUD view in viewpath
bee generate docs
generate swagger doc file
@ -111,6 +111,15 @@ func generateCode(cmd *Command, args []string) {
ColorLog("[HINT] Usage: bee generate controller [filename]\n")
os.Exit(2)
}
case "view":
if len(args) == 2 {
cname := args[1]
generateView(cname, curpath)
} else {
ColorLog("[ERRO] Wrong number of arguments\n")
ColorLog("[HINT] Usage: bee generate view [filename]\n")
os.Exit(2)
}
default:
ColorLog("[ERRO] command is missing\n")
}