|
|
|
|
@ -29,6 +29,7 @@ type PhpTemplate struct { |
|
|
|
|
// Declare type pointer to a template
|
|
|
|
|
var temp_ctrl *template.Template |
|
|
|
|
var temp_inputs *template.Template |
|
|
|
|
var temp_logic *template.Template |
|
|
|
|
var temp_models *template.Template |
|
|
|
|
var temp_outputs *template.Template |
|
|
|
|
var temp_views *template.Template |
|
|
|
|
@ -38,6 +39,7 @@ func init_template() { |
|
|
|
|
// template.Must takes the reponse of template.ParseFiles and does error checking
|
|
|
|
|
temp_ctrl = template.Must(template.ParseFiles(root + "/go_text_templates/ctrl.txt")) |
|
|
|
|
temp_inputs = template.Must(template.ParseFiles(root + "/go_text_templates/inputs.txt")) |
|
|
|
|
temp_logic = template.Must(template.ParseFiles(root + "/go_text_templates/logic.txt")) |
|
|
|
|
temp_models = template.Must(template.ParseFiles(root + "/go_text_templates/models.txt")) |
|
|
|
|
temp_outputs = template.Must(template.ParseFiles(root + "/go_text_templates/outputs.txt")) |
|
|
|
|
temp_views = template.Must(template.ParseFiles(root + "/go_text_templates/views.txt")) |
|
|
|
|
@ -89,6 +91,17 @@ func inputs() { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func logic() { |
|
|
|
|
mydir := "/logic/" + app_dir |
|
|
|
|
make_a_dir(mydir) |
|
|
|
|
file := use_file(mydir + "/" + main_file + "_logic.php") |
|
|
|
|
|
|
|
|
|
temp_err := temp_inputs.Execute(file, php_tpl) |
|
|
|
|
if temp_err != nil { |
|
|
|
|
log.Fatalln(temp_err) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func models() { |
|
|
|
|
mydir := "/models/" + app_dir |
|
|
|
|
make_a_dir(mydir) |
|
|
|
|
@ -200,6 +213,7 @@ func main() { |
|
|
|
|
grab_input() |
|
|
|
|
ctrl() |
|
|
|
|
inputs() |
|
|
|
|
logic() |
|
|
|
|
models() |
|
|
|
|
outputs() |
|
|
|
|
views() |
|
|
|
|
|