void smarty_function_name(array $params, object &$smarty) All attributes passed to template functions from the template are contained in the $params as an associative array. Either access those values directly, e.g. $params['start'] or use
void smarty_block_name(array $params, mixed $content, object &$smarty) Block functions are functions of the form: {func} .. {/func}. In other words, they enclose a template block and operate on the contents of this block. Block functions take
Plugins are always loaded on demand. Only the specific modifiers, functions, resources, etc invoked in the templates scripts will be loaded. Moreover, each plugin is loaded only once, even if you have several different instances of Smarty running
Compiler functions are called only during compilation of the template. They are useful for injecting PHP code or time-sensitive static content into the template. If there is both a compiler function and a custom function registered under the same
Plugin files and functions must follow a very specific naming convention in order to be located by Smarty. 外掛程式檔案和函數必須遵循特定的命名規範以便Smarty識別。 The plugin files must be named as follows: 外掛程式檔案必須命名如下: type.name.php Where type is one of these plugin
Output filter plugins operate on a template's output, after the template is loaded and executed, but before the output is displayed.輸出過濾器外掛程式的作用是,在裝載並執行完一個模板之後顯示模板之前,操作該模板的輸出。 string smarty_outputfilter_name(string $template_output, object
Prefilter and postfilter plugins are very similar in concept; where they differ is in the execution -- more precisely the time of their execution.從概念上看,預濾器和後濾器外掛程式都很簡單;不同之處就在於它們的執行,更確切地說是它們的執行時刻(非時間段,而是某一個時刻)。 string smarty_prefilter_name(string