Get Smarty

Donate

Donate Bitcoin Bitcoin
Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Buy cheap eyeglasses from Cheapglasses123.com and save up to 80%.

Buy prescription glasses from www.australiaglasses.com and save.

Cheap Glasses Now On Sale at GlassesPeople.com. Starts At $7.95.

Where to buy discount wedding dresses and cheap smart dresses free shipping - Weddingdresstrend.com

Brautkleider auf Topwedding.de

Find free files to download on allwhatyouwant.net

Looking For Affordable Wedding Dresses 2015 at Best Prices On TDBridal.com

Shop high quality cheap prom dresses on Dresswe.co.uk

Buy New Arrival Cheap Prom Dresses 2015 at JDBRIDAL Prom Dress Store

Advertisement

{function}

{function}鐢ㄤ簬鍦ㄦā鏉垮唴鍒涘缓鍑芥暟锛岃繖浜涘嚱鏁板彲浠ュ儚鎻掍欢鍑芥暟涓鏍疯皟鐢ㄣ 鐢ㄨ繖涓柟寮忔潵浠f浛鍐欐彃浠舵潵鏄剧ず鍐呭锛屾洿鍏锋湁鍙鐞嗘с 杩欎篃鍙互绠鍖栨暟鎹殑澶嶆潅搴︼紝濡傚灞傜粨鏋勭殑鑿滃崟銆

Note

妯℃澘鍑芥暟鏄叏灞鐨勩傚洜涓篠marty鐨勭紪璇戝櫒鏄崟娆$紪璇戠殑锛屾墍浠ュ繀椤荤敤 {call} 鏍囩鏉ヨ皟鐢ㄥ畾涔夊湪褰撳墠妯℃澘鐨勫嚱鏁般 鎴栬呬綘鍙互鐩存帴浣跨敤鍑芥暟锛屽{funcname ...}

  • {function}鏍囩蹇呴』璁剧疆name灞炴э紝 涔熷氨鏄ā鏉垮嚱鏁扮殑鍚嶇О銆 璇ュ悕绉板彲浠ョ敤浜庤皟鐢ㄦā鏉垮嚱鏁般

  • 鍙互鎸灞炴鐨勬柟寮忎紶閫掔粰妯℃澘鍑芥暟鍙橀噺榛樿鍊笺 鍜孭HP鍑芥暟瀹氫箟涓鏍凤紝浣犲彧鍙互浣跨敤鏍囬噺鍊间綔涓洪粯璁ゃ 榛樿鍊煎彲浠ヨ瑕嗙洊锛屽綋妯℃澘鍑芥暟琚皟鐢ㄧ殑鏃跺欍

  • 浣犲彲浠ュ湪璋冪敤妯℃澘鍑芥暟鍐呬娇鐢ㄥ綋鍓嶆ā鏉跨殑鍏ㄩ儴鍙橀噺锛屽湪妯℃澘鍐呭垱寤烘垨淇敼鐨勫彉閲忓氨涓嶈兘琚ā鏉垮嚱鏁板唴璁块棶浜嗐

灞炴:

鍙傛暟鍚嶇О 绫诲瀷 蹇呴夊弬鏁 榛樿鍊 璇存槑
name string Yes n/a 妯℃澘鍑芥暟鐨勫悕绉
[var ...] [var type] No n/a 妯℃澘鍑芥暟鍙傛暟鐨勯粯璁ゅ

Note

褰撴ā鏉垮嚱鏁拌璋冪敤鏃讹紝浣犲彲浠ヤ紶閫掍换鎰忔暟閲忕殑鍙傛暟缁欏畠銆傞櫎闈炰綘闇瑕侀粯璁ゅ硷紝鍚﹀垯涓嶈鍦 {funcname ...}鏍囩鍐呭畾涔夊弬鏁般 榛樿鍊煎繀椤绘槸鏍囬噺鑰屼笖涓嶆槸鍙橀噺锛屽彉閲忓繀椤诲湪鍑芥暟璋冪敤鏃舵墠鑳戒紶閫掋

Example聽7.43.聽閫掑綊鑿滃崟 {function} 渚嬪瓙


{* define the function *}
{function name=menu level=0}
{function menu level=0}          {* short-hand *}
  <ul class="level{$level}">
  {foreach $data as $entry}
    {if is_array($entry)}
      <li>{$entry@key}</li>
      {menu data=$entry level=$level+1}
    {else}
      <li>{$entry}</li>
    {/if}
  {/foreach}
  </ul>
{/function}

{* create an array to demonstrate *}
{$menu = ['item1','item2','item3' => ['item3-1','item3-2','item3-3' =>
['item3-3-1','item3-3-2']],'item4']}

{* run the array through the function *}
{menu data=$menu}

  

杈撳嚭锛


* item1
* item2
* item3
      o item3-1
      o item3-2
      o item3-3
            + item3-3-1
            + item3-3-2
* item4

  

鍙傝 {call}

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 6 plus 17? (Are you human?)

Advertisement