Re: [SMARTY] Registering & loading plugins

From: Date: Thu, 02 May 2002 14:32:13 +0000
Subject: Re: [SMARTY] Registering & loading plugins
References: 1 2 3 4  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3987@lists.php.net to get a copy of this message
I hope I get this right ;-) Michal Prinke wrote:
Hello, Loading/registering plugins in the newest Smarty is quite unclear to me. Please correct me if I am wrong? * load_filter() includes a *.php file from plugins/ directory AND REGISTERS the filter (= it will be used to process current template);
Correct, it will be used on any templates processed after the filter is loaded.
* register_prefilter() registers a function that is already available in PHP's namespace;
Correct, register_*filter is not needed for filters in the plugin directory (use load_filter for those), this is only for applications that may have their own custom filters and you want to register them.
* autoload_filters() is equal to performing a series of load_filter() calls;
$autoload_filters is a class variable, not a function. Any plugins in the $autoload_filters array are automatically loaded every time smarty is invoked. load_filters() is used in your application to load a specific filter from the plugin directory (pre, post, or output)
* variable modifiers are always auto-loaded when needed.
Correct, functions and modifiers are found in the plugin directory by mere mention of them in a template. Since filters are not something mentioned in a template, they must be loaded so Smarty knows which filters to apply to the templates. -- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.

« previous php.smarty.general (#3987) next »