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

show

show is used as a parameter to section. show is a boolean value, true or false. If false, the section will not be displayed. If there is a sectionelse present, that will be alternately displayed.

show 是 section 的参数. show 取值为布尔值 true 或 false. 如果设置为 false,该循环将不显示. 如果指定了 sectionelse 子句,该字句是否显示也取决于该值.

Example 7-29. section attribute show
Smarty手册范例 7-29. section 的 show 属性演示

	{* $show_customer_info may have been passed from the PHP
	application, to regulate whether or not this section shows *}
	{section name=customer loop=$custid show=$show_customer_info}
	{$smarty.section.customer.rownum} id: {$custid[customer]}<br>
	{/section}

	{if $smarty.section.customer.show}
	the section was shown.
	{else}
	the section was not shown.
	{/if}


	输出结果:

	1 id: 1000<br>
	2 id: 1001<br>
	3 id: 1002<br>

	the section was shown.
这是一份简单的Smarty手册和Smarty教材,熟练掌握Smarty模板,让您做项目事半功倍