上QQ阅读APP看书,第一时间看更新
The Update function
The Update function invokes the ExecuteTemplate method with writer and customer looked up by id. The ExecuteTemplate method renders the UPDATE template:
// Update - execute template
func Update(writer http.ResponseWriter, request *http.Request) {
var customerId int
var customerIdStr string
customerIdStr = request.FormValue("id")
fmt.Sscanf(customerIdStr, "%d", &customerId)
var customer Customer
customer = GetCustomerById(customerId)
template_html.ExecuteTemplate(writer,"Update",customer)
}