||$source, |
| |$template_)
;|
string $source
;;
|string smartypostfilter_name(
|$compiled, |
| |$template_)
;|
;object $template
;
Example 18.7. 前置过滤器
- <?php
- /*
- * Smarty plugin
- * -------------------------------------------------------------
- * File: postfilter.post01.php
- * Name: post01
- * Purpose: 列出当前模板的变量
- * -------------------------------------------------------------
- */
- function smarty_postfilter_post01($compiled, Smarty_Internal_Template $template)
- $compiled = "<pre>\n<?php print_r(\$template->getTemplateVars()); ?>\n</pre>" . $compiled;
- return $compiled;
- }
- ?>