- Move to $GOPATH/src/my-first-beego-project/views and create dashboard.tpl and copy the following content:
<!DOCTYPE html><html> <body> <table border= "1" style="width:100%;"> {{range .employees}} <tr> <td>{{.Id}}</td> <td>{{.FirstName}}</td> <td>{{.LastName}}</td> </tr> {{end}} </table> </body></html>
- Move to $GOPATH/src/my-first-beego-project/controllers and edit firstcontroller.go to add the Dashboard handler, as follows:
package controllersimport "github.com/astaxie/beego"type FirstController struct { beego.Controller}type Employee struct { Id int `json:"id"` FirstName string `json:"firstName"` LastName string `json:"lastName"`}type Employees []Employeevar employees []Employeefunc init() { employees = Employees { Employee{Id: ...