Smartyでテーブルの隙間を詰める

  1. <tr>
  2. [テーブル作成用のループ]
  3. {assign var='cnt' value=$record|@count}
  4. {if $cnt%5>0}
  5.   {section name='loop1' start=$cnt%5 loop=5}
  6.     <td>&nbsp;</td>
  7.   {/section}
  8. {/if}
  9. </tr>


このくらいが見やすいか… プラグイン作るほどでもないし。
もう少し考えれば if 文を省略できそうな....


追記

http://xfield.info/modules/tautech/category0025.html
便利チップが置いてあるのでメモ。


http://xfield.info/modules/tautech/content0129.html
トリプルクオートってのは初めてみた。

内部的に parse_ini_file() 関数を使ってるならもしかして Zend_Config_Ini でも使えるのかな?