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" ...
随机推荐
- 小程序Flex布局
容器属性 容器支持的属性有:display:通过设置display属性,指定元素是否为Flex布局.flex-direction:指定主轴方向,决定了项目的排列方式.flex-wrap:排列换行设置. ...
- 树的总结(遍历,BST,AVL原型,堆,练习题)
目录 树 一.抽象数据类型 二.二叉树的性质 三.二叉树的遍历 三.活用树的遍历 四.BST树 五.AVL树 六.BST树和AVL树练习 七.堆 树 @ 一.抽象数据类型 1.顺序存储 使用数组存储 ...
- 深入理解Java虚拟机——读书笔记
首先 强烈推荐周志明老师的这本书,真的可以说是(起码中文出版界)新手了解Java虚拟机必须人手一本的教科书!!! 第二部分自动内存管理机制 由于Java虚拟机的多线程是通过线程轮流切换并分配处理器 ...
- 01 数据库sql
1, 关于mysql,常去的地方有:https://www.yiibai.com/mysql, http://tool.oschina.net/apidocs/apidoc?api=mysql-5.1 ...
- Error creating bean with name 'xxxx' defined in URL
遇到这种情况,要检查一下以下配置: 1) service接口实现类上有没有加@Service注解,注解是不是引用的spring的类?不要导错包 2) 接口有没有写实现类,实现类是实现的对应接口么?比如 ...
- metal docs--Synchronization&memory management
https://developer.apple.com/documentation/metal/heaps/image_filter_graph_with_heaps_and_fences?langu ...
- Mysql判断是否某个字符串在某字符串字段的4种方法
方法一:like SELECT * FROM 表名 WHERE 字段名 like "%字符%"; 方法二:find_in_set() 利用mysql 字符串函数 find_in_s ...
- Java 集合存储都返回什么?
1.抛出一个类 package com.math.spring; import com.google.common.collect.Lists; import com.google.common.co ...
- JavaScript三元运算符
㈠条件运算符也叫做三元运算符 ⑴语法:条件表达式?语句1:语句2: ⑵执行的流程: ①条件运算符在执行时,首先对条件表达式进行求值 ▶如果该值为true,则执行语句1,并返回执行结果 ▶如果该值为fa ...
- 爬当当网上python书籍的图片
1.分析网页代码,获取图片下载连接:http://img3m4.ddimg.cn/20/11/23473514-1_b_5.jpg 2. python实现代码 import os import re ...