开发者

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>
% }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜