【发布时间】:2012-08-03 22:39:32
【问题描述】:
这是一个非常简单的问题,但它激怒了我。例如,我想评论以下内容:
<!--
{if $scenes}
<!-- Scenes -->
{include file="$tpl_dir./scenes.tpl" scenes=$scenes}
{else}
<!-- Category image -->
{if $category->id_image}
<div class="align_center">
<img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" />
</div>
{/if}
{/if}
-->
我想注释掉所有这些文本,所以浏览器不会显示此代码。问题是我已经有 cmets 并且浏览器似乎混淆了结束标记。因此在这种情况下,当我希望它影响整个文本时,第一个打开的评论标签只会影响 {if $scenes}。你能告诉我怎么做吗?!?!
谢谢,
丹尼
【问题讨论】:
-
我的解决方案:不要(因为 SGML/HTML/XML 不支持它).. 使用 DVCS 和/或其他“历史”;-) 话虽如此,也许是引擎/模板有可以使用的替代评论吗?例如,在 ASP.NET 中,
<%-- This is a comment that doesn't even get into the HTML output --%>