literal

Literal tags allow a block of data to be taken literally. This is typically used around javascript or stylesheet blocks where curly braces would interfere with the template delimiter syntax. Anything within {literal}{/literal} tags is not interpreted, but displayed as-is. If you need template tags embedded in your literal block, consider using {ldelim}{rdelim} to escape the individual delimiters instead.

literal 標籤可以讓區塊內的資料序列化輸出,通常的使用情況是在要輸出有可能會 被誤認為阻斷符號的大括弧內容的 javascript 或 stylesheet 程式碼區塊。任何在 {literal}{/literal} 標籤內的文字都不會被翻譯,而是會被如實的呈現出來。如果你需要在 literal 區塊中嵌入樣板標籤的話,請考慮使用 {ldelim}{rdelim} 脫序個別的阻段符號。

Example 7-13. literal 標籤

{literal}
	<script type="text/javascript">

        	<!--
                	function isblank(field) {
                	if (field.value == '')
                        	{ return false; }
                	else
                        	{
                        	document.loginform.submit();
                        	return true;
                        	}
                	}
        	// -->

	</script>
{/literal}