av手机免费在线观看,国产女人在线视频,国产xxxx免费,捆绑调教一二三区,97影院最新理论片,色之久久综合,国产精品日韩欧美一区二区三区

php語言

PHP框架之Smarty中的注釋和截?cái)喙δ芙榻B

時(shí)間:2025-03-15 02:52:21 php語言 我要投稿
  • 相關(guān)推薦

PHP框架之Smarty中的注釋和截?cái)喙δ芙榻B

  這篇文章主要介紹了Smarty中的注釋和截?cái)喙δ芙榻B,這兩個(gè)功能都是Smarty中不太常用的功能,但非常實(shí)用,需要的朋友可以參考下。更多消息請關(guān)注應(yīng)屆畢業(yè)生網(wǎng)。

  注釋

  代碼如下:

  {* 這是一個(gè)單行Smarty注釋 來自于jb51.net,網(wǎng)頁源代碼里看不見*}

  {* 這是一個(gè)多行

  Smarty注釋

  并不發(fā)送到瀏覽器

  *}

  模板注釋由星號包圍,繼而由分隔符包圍,型如:{* 這是一個(gè)注釋 *}。Smarty注釋不會在最終模板的輸出中顯示,這點(diǎn)和不同。前者對于在模板中插入內(nèi)部注釋有用,因?yàn)闆]有人能看到。;-)

  截?cái)鄑runcate

  代碼如下:

  $smarty->assign('hxtitle', 'Two Sisters Reunite after Eighteen Years at Checkout Counter.');

  模板為:

  代碼如下:

  {$hxtitle}

  {$hxtitle|truncate}

  {$hxtitle|truncate:30}

  {$hxtitle|truncate:30:""}

  {$hxtitle|truncate:30:"---"}

  {$hxtitle|truncate:30:"":true}

  {$hxtitle|truncate:30:"...":true}

  {$hxtitle|truncate:30:'..':true:true}

  輸出為:

  代碼如下:

  Two Sisters Reunite after Eighteen Years at Checkout Counter.

  Two Sisters Reunite after Eighteen Years at Checkout Counter.

  Two Sisters Reunite after...

  Two Sisters Reunite after

  Two Sisters Reunite after---

  Two Sisters Reunite after Eigh

  Two Sisters Reunite after E...

  Two Sisters Re..ckout Counter.

【PHP框架之Smarty中的注釋和截?cái)喙δ芙榻B】相關(guān)文章:

PHP中--autoload和Smarty沖突的解決方法07-23

PHP中Yii框架之表單驗(yàn)證規(guī)則06-08

php-smarty模版引擎中的緩存應(yīng)用04-23

利用PHP模板引擎smarty05-04

PHP及其功能介紹03-28

php中的注釋包括哪些03-07

php中的socket框架性能分析07-17

PHP框架的概念07-11

php中實(shí)現(xiàn)回刪功能實(shí)例01-26