Conditional in Mason code
If I want to create a block of html code that displays if a boolean value in mason is true is there a way to do this without using print to print each line of the h开发者_C百科tml code? i.e. is there a way to do something like this
<% if($boolean) { %>
<li>
<a href='http://somesite.com'>link</a>
</li>
<% } %>
instead of
<%perl>
if($boolean) {
print "<li>";
print "<a href='http://somesite.com'>link</a>";
print "</li>";
}
</%perl>
As you mention in your comment, you can:
% if($boolean) {
<li>
<a href='http://somesite.com'>link</a>
</li>
% }
精彩评论