1 | <?php |
||
8 | abstract class Plugin { |
||
9 | |||
10 | /** |
||
11 | * Autoload path for plugin. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $path; |
||
16 | |||
17 | /** |
||
18 | * Create a new plugin instance. |
||
19 | 134 | * |
|
20 | * @param array $config |
||
21 | 134 | * @return void |
|
|
|||
22 | 134 | */ |
|
23 | public function __construct($config = null) |
||
29 | 134 | ||
30 | /** |
||
31 | 134 | * Configure the plugin. |
|
32 | 134 | * |
|
33 | 134 | * @param array $config |
|
34 | * @return void |
||
35 | */ |
||
36 | public function configure($config) |
||
45 | |||
46 | /** |
||
47 | * Set the plugin autoload path. |
||
48 | * |
||
49 | * @return void |
||
50 | */ |
||
51 | public function setPath() |
||
55 | |||
56 | /** |
||
57 | * Get autoload path. |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | public function path($append = null) |
||
66 | |||
67 | /** |
||
68 | * Get paths to templates. |
||
69 | * |
||
70 | * @return string |
||
71 | */ |
||
72 | public function templatePaths() |
||
77 | |||
78 | 134 | /** |
|
79 | 134 | * Trigger an event callback. This allows |
|
80 | * you to hook into events from within the plugin. |
||
81 | * - onLoad |
||
82 | 134 | * - onDefine |
|
83 | * - onRender |
||
84 | * - onSubmitted |
||
85 | * - onCompleted |
||
86 | * - onValidate |
||
87 | * - onValidated |
||
88 | * - onValid |
||
89 | * - onInvalid |
||
90 | * |
||
91 | * @param \Helmut\Forms\Form $form |
||
92 | * @param string $name |
||
93 | * @param array $params |
||
94 | * @return mixed |
||
95 | */ |
||
96 | public function event($form, $name, $params = []) |
||
105 | |||
106 | } |
||
107 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.