| 148 |
lars |
1 |
How Plugins Work {#plugins.howto}
|
|
|
2 |
================
|
|
|
3 |
|
|
|
4 |
Plugins are always loaded on demand. Only the specific modifiers,
|
|
|
5 |
functions, resources, etc invoked in the templates scripts will be
|
|
|
6 |
loaded. Moreover, each plugin is loaded only once, even if you have
|
|
|
7 |
several different instances of Smarty running within the same request.
|
|
|
8 |
|
|
|
9 |
Pre/postfilters and output filters are a bit of a special case. Since
|
|
|
10 |
they are not mentioned in the templates, they must be registered or
|
|
|
11 |
loaded explicitly via API functions before the template is processed.
|
|
|
12 |
The order in which multiple filters of the same type are executed
|
|
|
13 |
depends on the order in which they are registered or loaded.
|
|
|
14 |
|
|
|
15 |
The [plugins directory](#variable.plugins.dir) can be a string
|
|
|
16 |
containing a path or an array containing multiple paths. To install a
|
|
|
17 |
plugin, simply place it in one of the directories and Smarty will use it
|
|
|
18 |
automatically.
|