PHPDevShell Template modules
2010-01-25 22:59:36   来源:   评论:0 点击:

Template modules are small text snipets which are used when a portion of text or html is meant to be re-used often. For example, the "logo module" is:


   <a href="%1\$s" class="logo_link">
       <img src="%2\$s" class="logo" alt="%3\$s" title="%4\$s">


They are all stored in a single array.

You can use a module this way:


   $html_for_logo = sprintf($this->module['logo'], 


- when not using Smarty, just print the result:


   print $html_for_logo;


- when using Smarty, follow the Smarty syntax.



上一篇:PHPDevShell Templates and Typography
下一篇:PHPDevShell Navigation

分享到: 收藏