今天需要用到在smarty模版中將兩個變量相加

          1. {* $height=4, $width=5 *}
          2. {math equation="x + y" x=$height y=$width}
          3. OUTPUT:
          4. 9

          5. {* $row_height = 10, $row_width = 20, #col_div# = 2, assigned in template *}
          6. {math equation="height * width / division"
          7.       height=$row_height
          8.       width=$row_width
          9.       division=#col_div#}
          10. OUTPUT:
          11. 100

          12. {* you can use parenthesis *}
          13. {math equation="(( x + y ) / z )" x=2 y=10 z=2}
          14. OUTPUT:
          15. 6

          16. {* you can supply a format parameter in sprintf format *}
          17. {math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
          18. OUTPUT:
          19. 9.44

          posted on 2008-12-11 00:11 丁克設計 閱讀(1601) 評論(0)  編輯  收藏 所屬分類: PHP技術文檔

          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          導航

          留言簿(6)

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          主站蜘蛛池模板: 延川县| 静乐县| 体育| 荥阳市| 柳州市| 滦平县| 泸溪县| 公主岭市| 察雅县| 通化市| 敦化市| 宜章县| 图片| 久治县| 体育| 澄城县| 桑日县| 上林县| 平度市| 鹤岗市| 平陆县| 仲巴县| 河池市| 都昌县| 阿拉善盟| 东乡族自治县| 墨竹工卡县| 汤阴县| 清原| 绥棱县| 新津县| 吐鲁番市| 长岛县| 澄迈县| 西乡县| 太原市| 临猗县| 河南省| 浮梁县| 荆州市| 龙里县|