码迷,mamicode.com
首页 > 其他好文 > 详细

smart模版学习笔记一

时间:2014-11-06 19:21:45      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:ar   for   sp   on   art   bs   as   学习   ui   

1、简单语句

1.1、foreach...if....else

      1.1.1 json内容:

{
"tag_require":["111","222","333","444","555","6666"]
}

      1.1.2  tpl页面

<{foreach $tag_require as $item}>
<{if $item@index < 4}>
<span class="<{if $item@index == 0}>current<{/if}>" title="<{$item}>" data-key="<{$item}>"><{$item|cut:14}></span>
<{else}>
<span><{$item}></span>
<{/if}>
<{/foreach}>

方法二:

<{foreach from=$org_vzone_docs item="unit" name="docList"}>

1.2、 赋值

<{$urlName = $unit.verify_uname}>

1.3、分配变量

 <{assign var="userNameUrl" value="userNameUrl"}>

也可以直接:

<{$userNameUrl = ‘userNameUrl‘}>

smart模版学习笔记一

标签:ar   for   sp   on   art   bs   as   学习   ui   

原文地址:http://www.cnblogs.com/huanglifen/p/4079423.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!