zoukankan      html  css  js  c++  java
  • smarty 流程控制总结

    smarty 流程控制总结
    1、文件导入
    <{include file="admin/pagefooter.htm"}>
    2、foreach 应用
    <{foreach from=$links item=link}>
     <li><a href="<{$link.href}>"><{$link.text}></a></li>
    <{/foreach}>
    3、if else 应用
    <{if $msg_type==0}>
    <img src="images/information.gif" width="32" height="32" border="0" alt="information" />
    <{elseif $msg_type eq 1}>
    <img src="images/warning.gif" width="32" height="32" border="0" alt="warning" />
    <{else}>
    <img src="images/confirm.gif" width="32" height="32" border="0" alt="confirm" />
    <{/if}>
    4、注释
    <!-- saved from url=(0053)http://localhost/sqecshop/admin/category.php?act=list -->
    5、直接显示
    <{$alluser}>
    6、section应用
    <{section name=nloop loop=$news_data}>
      <tr align="center" bgcolor="<{cycle values="#f1f2f3,#ffffff"}>">
        <td><a href="show<{$news_data[nloop].id}>.htm"><{$news_data[nloop].title}></a></td>
        <td><{$news_data[nloop].add_date|date_format:"%Y-%m-%d"}></td>
        <td><{$news_data[nloop].hits}></td>
      </tr>
    <{sectionelse}>
    <tr><td colspan="3">对不起,没有任何新闻输入!</td></tr>
    <{/section}>
  • 相关阅读:
    Fedora/CentOS/RHEL删除旧的内核
    Linux下使Shell命令脱离终端运行
    保持tmux窗口名更改后不变
    Centos7 修改ssh 默认端口号
    验证码生成代码
    Json帮助类代码
    Http请求代码
    cookies读写代码
    缓存读写代码
    数据读写 CommonCurd
  • 原文地址:https://www.cnblogs.com/fengju/p/6174116.html
Copyright © 2011-2022 走看看