HBcms是一个用Pear框架+Smarty模板引擎构架的cms项目,欢迎大家参与制作Smarty模板

literal

Literal tags allow a block of data to be taken literally, not being interpreted by the Smarty engine. This is handy for things like javascript sections, where there maybe curly braces and such things that would confuse the template parser. Anything within {literal}{/literal} tags is not interpreted, but displayed as-is.

Literal 标签区域内的数据将被当作文本处理,此时模板将忽略其内部的所有字符信息. 该特性用于显示有可能包含大括号等字符信息的 javascript 脚本. 当这些信息处于 {literal}{/literal} 标签中时,模板引擎将不分析它们,而直接显示.

Example 7-13. literal tags
Smarty手册范例 7-13. literal 标签演示

{literal}
	<script language=javascript>

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

	</script>
{/literal}
这是一份简单的Smarty手册和Smarty教材,熟练掌握Smarty模板,让您做项目事半功倍