首页 > 其他 > 详细

Smarty属性

时间:2015-02-22 15:43:53      阅读:259      评论:0      收藏:0      [点我收藏+]

Attributes

[属性]

大多数函数都带有自己的属性以便于明确说明或者修改他们的行为. 
smarty函数的属性很像HTML中的属性. 
静态数值不需要加引号,但是字符串建议使用引号. 
如果用变量作属性,它们也不能加引号.

一些属性用到了布尔值(真或假).
它们不需要加引号,可以是true,on,yes或者false,off,no.


例 3-3.函数属性语法

 
{include file="header.tpl"}

{include file=$includeFile}

{include file=#includeFile#}

{html_select_date display_days=yes}

<SELECT name=company>
{html_options values=$vals selected=$selected output=$output}
</SELECT>

调用

$smarty->assign("vals",array("a","b"));
$smarty->assign("selected","selected");
$smarty->assign("output",array("e","d"));

Smarty属性

原文:http://www.cnblogs.com/danmao/p/4297496.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!