模板
本文档仅适用于github.com/gobuffalo/buffalo/rende...。有关更多模板包的更多详细信息,请参阅github.com/gobuffalo/plush
Buffalo默认使用plush作为其模板引擎。
一般用法
// templates/index.html
<h1><%= name %>
<ul>
<%= for (name) in names { %>
<li><%= name %>
<% } %>
</ul>
if else用法
<%= if (true) { %>
<!-- render this -->
<% } %>
<%= if (false) { %>
<!-- won't render this -->
<% } else { %>
<!-- render this -->
<% } %>