You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hero doesn't support extends template dynamically. You can write two template, one is for Ajax and the other one not, and then check the ajax value in the handler.
I want to check request if its ajax or not , then extend the layout.
But this code doesn't work:
`<%: func UserList(userList []string,ajax bool, buffer *bytes.Buffer) %>
<% if !ajax { %>
<%~ "index.html" %>
<% } %>
<%@ body { %>
<% for _, user := range userList { %>
<%+ "user.html" %>
<% } %>
<% } %>
`
The text was updated successfully, but these errors were encountered: