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">
   </a>

 

They are all stored in a single array.

You can use a module this way:

 

   $html_for_logo = sprintf($this->module['logo'], 
       $this->configuration['absolute_url'], 
       $this->configuration['custom_logo'], 
       $this->configuration['scripts_name_version'], 
       $this->configuration['scripts_name_version']);

 

- 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

分享到: 收藏
频道总排行
频道本月排行