| 148 |
lars |
1 |
Naming Conventions {#plugins.naming.conventions}
|
|
|
2 |
==================
|
|
|
3 |
|
|
|
4 |
Plugin files and functions must follow a very specific naming convention
|
|
|
5 |
in order to be located by Smarty.
|
|
|
6 |
|
|
|
7 |
**plugin files** must be named as follows:
|
|
|
8 |
|
|
|
9 |
> `
|
|
|
10 |
> type.name.php
|
|
|
11 |
> `
|
|
|
12 |
|
|
|
13 |
- Where `type` is one of these plugin types:
|
|
|
14 |
|
|
|
15 |
- function
|
|
|
16 |
|
|
|
17 |
- modifier
|
|
|
18 |
|
|
|
19 |
- block
|
|
|
20 |
|
|
|
21 |
- compiler
|
|
|
22 |
|
|
|
23 |
- prefilter
|
|
|
24 |
|
|
|
25 |
- postfilter
|
|
|
26 |
|
|
|
27 |
- outputfilter
|
|
|
28 |
|
|
|
29 |
- resource
|
|
|
30 |
|
|
|
31 |
- insert
|
|
|
32 |
|
|
|
33 |
- And `name` should be a valid identifier; letters, numbers, and
|
|
|
34 |
underscores only, see [php
|
|
|
35 |
variables](&url.php-manual;language.variables).
|
|
|
36 |
|
|
|
37 |
- Some examples: `function.html_select_date.php`, `resource.db.php`,
|
|
|
38 |
`modifier.spacify.php`.
|
|
|
39 |
|
|
|
40 |
**plugin functions** inside the PHP files must be named as follows:
|
|
|
41 |
|
|
|
42 |
> `smarty_type_name`
|
|
|
43 |
|
|
|
44 |
- The meanings of `type` and `name` are the same as above.
|
|
|
45 |
|
|
|
46 |
- An example modifier name `foo` would be
|
|
|
47 |
`function smarty_modifier_foo()`.
|
|
|
48 |
|
|
|
49 |
Smarty will output appropriate error messages if the plugin file it
|
|
|
50 |
needs is not found, or if the file or the plugin function are named
|
|
|
51 |
improperly.
|