上QQ阅读APP看书,第一时间看更新
The Create template
The Create template consists of Header, Menu, and Footer templates. The form to create customer fields is found in the create template. This form is submitted to a web path—/insert, as shown in the following code snippet (Create.tmpl):
{{ define "Create" }}
{{ template "Header" }}
{{ template "Menu" }}
<br>
<h1>Create Customer</h1>
<br>
<br>
<form method="post" action="/insert">
Customer Name: <input type="text" name="customername" placeholder="customername" autofocus/>
<br>
<br>
SSN: <input type="text" name="ssn" placeholder="ssn"/>
<br>
<br>
<input type="submit" value="Create Customer"/>
</form>
{{ template "Footer" }}
{{ end }}