smarty section 循环不同的四个样式
<div class="moban_spzs">
<{section name=goodslist loop=$strdata6}>
<{if $smarty.section.goodslist.first}>
<div class="moban_spzsleft">
<p><{$strdata6[goodslist].name}></p>
<dd>¥<{$strdata6[goodslist].price}></dd>
<a href=goods_details.php?id=<{$id}>&categoryId=<{$strdata2[goodslist].categoryId}>&cmid=<{$strdata6[goodslist].cmid}>><img src="<{$strdata6[goodslist].faceImg}>"alt=""></a>
</div>
<{elseif $smarty.section.goodslist.index<2}>
<div class="moban_spzscont">
<p><{$strdata6[goodslist].name}></p>
<dd>¥<{$strdata6[goodslist].price}></dd>
<a href=goods_details.php?id=<{$id}>&categoryId=<{$strdata2[goodslist].categoryId}>&cmid=<{$strdata6[goodslist].cmid}>><img src="<{$strdata6[goodslist].faceImg}>"alt=""></a>
</div>
<{elseif $smarty.section.goodslist.index<3}>
<div class="moban_spzsright">
<div class="mobanright_div">
<p><{$strdata6[goodslist].name}></p>
<dd>¥<{$strdata6[goodslist].price}></dd>
<a href=goods_details.php?id=<{$id}>&categoryId=<{$strdata2[goodslist].categoryId}>&cmid=<{$strdata6[goodslist].cmid}>><img src="<{$strdata6[goodslist].faceImg}>"alt=""></a>
</div>
<{elseif $smarty.section.goodslist.index<4}>
<div class="mobanright_div1">
<p><{$strdata6[goodslist].name}></p>
<dd>¥<{$strdata6[goodslist].price}></dd>
<a href=goods_details.php?id=<{$id}>&categoryId=<{$strdata2[goodslist].categoryId}>&cmid=<{$strdata6[goodslist].cmid}>><img src="<{$strdata6[goodslist].faceImg}>"alt=""></a>
</div>
</div>
<{/if}>
<{/section}>
</div>
smarty section 循环不同的四个样式的更多相关文章
- smarty模板引擎中section循环loop与total的区别
在smarty模板引擎的section循环中 $data=[101,102,103,105,104]; section的两个属性total与loop {section foo $data start= ...
- smarty在循环的时候计数来显示这是第几次循环的功能
想必有很多人比较喜欢这个smarty循环的时候有个变量增加的功能或比较需要这个功能吧?其实不需要额外的变量,当然你也许根本用不了.我们用smarty内置的就可以了.就是smarty有foreach和s ...
- Smarty section、foreach控制循环次数的实现详解
<!--{ section name='i' loop=$a }--><!--{ if $smarty.section.i.index < 3 }--><!--{ ...
- php smarty section使用
文件:section.tpl <html> <head> <title></title> </head> <body> {sec ...
- UITableViewCellStyle 四种样式
四种样式如下:
- 实验四 CSS样式的应用
实验四 CSS样式的应用 注意:以下实验项目皆以本文件为操作对象,实验结果用记事本保留后预览,最后将添加的CSS代码转载到实验报告中 另本网页中蓝色加下划线的字即为默认的超链接样式 实验目的: 掌握 ...
- CSS 四种样式表 六种规则选择器 五种常用样式属性
新的html程序要在VS中编写了,在vs中安装ASP.NET和Web开发,并用ASP.NET Web 应用程序(.NETFramework)创建一个网页程序.添加一个html页 后面的代码都是在htm ...
- Smarty的循环
(1)section.sectionelse功能多,参数多.或许不是太实用.是smarty用来做循环操作的函数之一.(2)了解基本属性name和loop <section name=articl ...
- 9.Smarty的循环
1.session循环 目的:循环输出一个二维数组 构造一个二维数组 $towSide = array( array("name"=>"caimuqing" ...
随机推荐
- CAFFE(三):Ubuntu下Caffe框架安装(仅仅Caffe框架安装)
步骤一. 从github上下载(克隆)安装包 1.1 在你要安装的路径下 clone 此处我直接安装到home目录,执行: ~$ cd ~ 2 :~$ git clone https://github ...
- day_03比特币转账的运行原理
在2008年全球经济危机中,中本聪想如果能构建一个没有中心机构的货币发行体系,货币就不会被无限发行,大家都很公平公正,于是中本聪构建了比特币这样一个体系: 一.非中心化下的比特币发行机制 比特币的发行 ...
- CentOS7 基于 subversion 配置 SVN server
由于 Window Server 环境下,VisualSVN Server Community 版本只支持 15 个同时在线用户,所以彻底放弃 Windows Server,在 Linux Serve ...
- BZOJ3331 [BeiJing2013]压力[圆方树+树上差分]
圆方树新技能get.具体笔记见图连通性问题学习笔记. 这题求无向图的必经点,这个是一个固定套路:首先,一张连通的无向图中,每对点双和点双之间是以一个且仅一个割点连接起来的(如果超过一个就不能是割点了) ...
- sql random string
begindeclare chars_str varchar(62) default 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123 ...
- Map遍历效率 : entrySet > keySet
1 //entrySet() 2 for (Entry<String, String> entry : map.entrySet()) { 3 Stri ...
- “景驰科技杯”2018年华南理工大学程序设计竞赛 A. 欧洲爆破(思维+期望+状压DP)
题目链接:https://www.nowcoder.com/acm/contest/94/A 题意:在一个二维平面上有 n 个炸弹,每个炸弹有一个坐标和爆炸半径,引爆它之后在其半径范围内的炸弹也会爆炸 ...
- IDEA 安装与破解(亲测有效)
本文转载:https://blog.csdn.net/g_blue_wind/article/details/74380483 根据以下的流程,顺利安装了最新版本的idea企业版. IDEA 全称 I ...
- OI程序常见的设计陷阱
宏定义的问题 有时候为了方便,我会大量使用宏定义.但是最近我发现下面这两个宏定义老是出问题: #define SET(x,a) memset(x,a,sizeof(x)) inline void wo ...
- codeforces#1187E. Tree Painting(树换根)
题目链接: http://codeforces.com/contest/1187/problem/E 题意: 给出一颗树,找到一个根节点,使所有节点的子节点数之和最大 数据范围: $2 \le n \ ...