diff --git a/docs.sgml b/docs.sgml index 9a32646e..e14e3ac2 100644 --- a/docs.sgml +++ b/docs.sgml @@ -833,6 +833,59 @@ $smarty->register_filter("remove_dw_comments"); $smarty->unregister_filter("imbed_asp_jokes"); + + + + + register_compiler_function + + + void register_compiler_function + string funcname + string funcimpl + + + + Use this to dynamically register template functions that are + executed only at compile time of the template. This useful for + injecting PHP code or time-sensitive static content into the + template. + + +register_compiler_function + + +// PHP code + +$smarty->register_compiler_function("tplheader","smarty_template_header"); + +function smarty_template_header() { + +} + +{* this function gets executed at compile time only *} +{tplheader} + + + + + + unregister_compiler_function + + + void unregister_compiler_function + string funcname + + + + Use this to dynamically unregister a compiler function. + + +unregister_compiler_function + + +$smarty->unregister_compiler_function("tplheader"); +