zoukankan      html  css  js  c++  java
  • 夺命雷公狗---Smarty NO:13 系统自定义函数(plugins)

    1、counter函数

    实现自动计数功能

    {counter start=0 skip=2 print=false}

    参数说明:

    start:起始位置

    skip:步阶

    print:当前是否打印

    demo5.html代码示例

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset=’utf-8′>
    <title></title>
    </head>
    <body>
    <ul>
    <li>{counter start=10 skip=3 print=false},aaaaaaaaaaa</li><!–false就不显示标号了–>
    <li>{counter},aaaaaaaaaaaaa</li>
    <li>{counter},aaaaaaaaaaaaaa</li>
    <li>{counter},aaaaaaaaaaaaaaa</li>
    </ul>
    </body>
    </html>

    2、cycle轮显函数

    实现对数值的轮显操作

    基本语法:

    <tr bgcolor=”{cycle values=”#eeeeee,#d0d0d0″}”>

    示例代码:实现隔行表色效果

    demo5.html示例代码:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset=’utf-8′>
    <title></title>
    </head>
    <body>
    <table border=’1′ width=’500′>
    <tr bgcolor='{cycle values=”red,blue,yellow”}’>
    <td>编号</td>
    <td>姓名</td>
    </tr>
    <tr bgcolor='{cycle values=”red,blue,yellow”}’>
    <td>编号</td>
    <td>姓名</td>
    </tr>
    <tr bgcolor='{cycle values=”red,blue,yellow”}’>
    <td>编号</td>
    <td>姓名</td>
    </tr>
    <tr bgcolor='{cycle values=”red,blue,yellow”}’>
    <td>编号</td>
    <td>姓名</td>
    </tr>
    <tr bgcolor='{cycle values=”red,blue,yellow”}’>
    <td>编号</td>
    <td>姓名</td>
    </tr>
    </table>
    </body>
    </html>
  • 相关阅读:
    Round robin
    Linux命令之nslookup
    VLAN
    基础网络概念
    python开发_filecmp
    python开发_stat
    python开发_fileinput
    python开发_os.path
    python开发_bisect
    python开发_copy(浅拷贝|深拷贝)_博主推荐
  • 原文地址:https://www.cnblogs.com/leigood/p/5033342.html
Copyright © 2011-2022 走看看