March 2019
Intermediate to advanced
336 pages
9h 9m
English
The View template consists of Header, Menu, and Footer templates. The form to view the customer fields is found in the View template, which is presented in code as follows (View.tmpl):
{{ define "View" }} {{ template "Header" }} {{ template "Menu" }} <br> <h1>View Customer</h1> <br> <br><table border="1"><tr><td>CustomerId</td><td>CustomerName</td><td>SSN</td><td>Update</td><td>Delete</td></tr>{{ if . }} {{ range . }}<tr><td>{{ .CustomerId }}</td><td>{{ .CustomerName }}</td><td>{{ .SSN }}</td><td><a href="/delete?id={{.CustomerId}}" onclick="return confirm('Are you sure you want to delete?');">Delete</a> </td><td><a href="/update?id={{.CustomerId}}">Update</a> </td></tr>{{ end }} {{ end }}</table>{{ template "Footer" ...
Read now
Unlock full access