Home > php教程 > php手册 > body text

destoon实现调用自增数字从1开始的方法,destoon

WBOY
Release: 2016-06-13 09:26:46
Original
1313 people have browsed it

destoon实现调用自增数字从1开始的方法,destoon

本文示例讲述了destoon实现调用自增数字从1开始的方法,在进行数据调用的时候有一定的实用价值。希望对大家的destoon开发有所帮助。具体方法如下:

示例功能:destoon 调用自增数字 从1开始。

具体代码如下:

<!--{php $tags=tag("moduleid=14&length=46&condition=status=3&pagesize=10&order=hits desc&template=null");}--> 
               
{loop $tags $k $t}  
 <li>{php $k = ++$k;}  
   <a href="{$t[linkurl]}" rel="external nofollow" target="_blank" class="item"> 
     <span class="num">{$t[hits]}</span>  
     <i class="icon icon2">{$k++}</i>    
     <span class="txt f-ib f-thide">{$t[title]}</span> 
   </a>              
 </li>
{/loop}
Copy after login

destoon 怎让LOOP循环的时增加一个自增变量

我要在模板里输出 这个$i++; 怎么放{loop $tags $i $t}{$i++}imgUrl[{$i}]='{$t[thumb]}';imgLink[{$i}]='{$t[linkurl]}';imgText[{$i}]='{$t[alt]}';{/loop}或{loop $tags $i $t}imgUrl[{$i++}]='{$t[thumb]}';imgLink[{$i++}]='{$t[linkurl]}';imgText[{$i++}]='{$t[alt]}';{/loop}都不行
 

destoon 怎调用指定栏目下的二级栏目及信息数量

调用某一分类的信息在标签里传递catid参数,例如&catid=5表示调用分类ID为5的所有信息。如果调用多个分类,用逗号分隔分类ID,例如 &catid=5,6,7表示调用分类ID为5、6、7的所有信息。分类调用默认包含子分类的信息,如果不需要包含子分类,可设置&child=0参数。例如&catid=5&child=0表示只调用分类ID为5的信息,不包括子分类的信息。
 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!