三、PHP面向对象开发的学习.pptVIP

  • 2
  • 0
  • 约8.54千字
  • 约 42页
  • 2018-01-21 发布于河北
  • 举报
三、PHP面向对象开发的学习

PHP模板引擎Smarty内置函数 1、foreach 数组的处理 与我们在PHP中的foreach用法类似,同样是用来遍历数组。在实际操作中与 section 功能一样,但foreach在Smarty一般用来处理一维数组。 =======无键值数组 {foreach from=$name item=id} id: {$id}br {/foreach} =======无键值数组 {foreach key=j item=v from=$name } {$j}: {$v}br {/foreach} key 键值 item内容 from 数组 PHP模板引擎Smarty内置函数 2、include 多功能使用 {include file=header.htm} {include file=D:\www\head.htm} {include file=head.htm title=Main Menu} 3、IF条件语句的使用 {if $name==ok} {else} {/if} 同样支持elseif PHP模板引擎Smarty内置函数 4、literal strip 文本的处理技巧 literal 数据将被当作文本处理,此时模板将忽略其内部的所有字符信息. 该特性用 于显示有可能包含大括号等字符信息的 javascript 脚本 {literal}

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档