开发者

Conditional in Mason code

开发者 https://www.devze.com 2023-03-04 12:01 出处:网络
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

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

精彩评论

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