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" ...
随机推荐
- 【Day3】2.re模块使用案例
课程目标 1.提取 2.匹配 3.替换 1.提取 import re ret = re.findall([正则表达式]) # 返回的类型是列表 2.匹配 import re ret = re.matc ...
- 【异常】诡异的mysql错误,Pagehelper插件混乱导致吗
1 详细的异常信息 Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in ...
- Hadoop_28_MapReduce_自定义 inputFormat
1. 自定义inputFormat 1.1.需求: 无论hdfs还是mapreduce,对于小文件都有损效率,实践中,又难免面临处理大量小文件,此时就需要有相应解决方案; 1.2.分析: 小文件的优化 ...
- free命令详解-1
free命令可以显示Linux系统中空闲的.已用的物理内存及swap内存以及被内核使用的buffer.我们本篇学习如何使用free命令监控系统的内存情况. 一般使用free –m方式查看内存占用情况( ...
- Hosts 文件切换工具
建议删除无用的注释,否则在启用全部的时候会把注释和说明内容的注释取消掉 下载地址:
- mysqldump表损坏问题
遇到的问题:mysqldump: Error 1194: Table 'user' is marked as crashed and should be repaired when dumping t ...
- Python2.x与3.x版本区别Ⅲ
八进制字面量表示 八进制数必须写成0o777,原来的形式0777不能用了:二进制必须写成0b111. 新增了一个bin()函数用于将一个整https://www.xuanhe.net/数转换成二进制字 ...
- iosselect插件
好用的时间选择器/地址选择器插件 iosselect.js
- IntelliJ 如何显示代码的代码 docs
希望能够在 IntelliJ 代码上面显示方法的 docs. 如何进行显示? 你可以使用 Ctrl + Q 这个快捷键来查看方法的 Docs. https://blog.ossez.com/archi ...
- Dockerfile中echo使用
Dockerfile 中的echo的使用方式和bash中的使用方式是有区别的 下面是一个 Dockerfile 通过echo的方式更换apt-get源和pip源 FROM python:3.5.8-s ...