1 | <?php |
||
27 | class HelperPluginManager extends AbstractPluginManager |
||
28 | { |
||
29 | /** |
||
30 | * Default set of helpers factories |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $factories = [ |
||
35 | Helper\Absolutize::SERVICE => HelperFactory\AbsolutizeFactory::class, |
||
36 | Helper\Form::SERVICE => HelperFactory\FormFactory::class, |
||
37 | Helper\Translate::SERVICE => HelperFactory\TranslateFactory::class, |
||
38 | Helper\Pagination::SERVICE => HelperFactory\PaginationFactory::class, |
||
39 | ]; |
||
40 | |||
41 | /** |
||
42 | * Default set of helpers |
||
43 | * |
||
44 | * @var array |
||
45 | */ |
||
46 | protected $invokableClasses = [ |
||
47 | Element::SERVICE => Element::class, |
||
48 | ]; |
||
49 | |||
50 | /** |
||
51 | * Constructor |
||
52 | * |
||
53 | * After invoking parent constructor, add an initializer to inject the |
||
54 | * attached helper, if any, to the currently requested helper. |
||
55 | * |
||
56 | * @param null|ConfigInterface $configuration |
||
57 | */ |
||
58 | public function __construct(ConfigInterface $configuration = null) |
||
68 | |||
69 | /** |
||
70 | * Inject a helper instance with the EventManager |
||
71 | * |
||
72 | * @param HelperInterface $helper |
||
73 | */ |
||
74 | public function injectEventManager(HelperInterface $helper) |
||
86 | |||
87 | /** |
||
88 | * Inject a helper instance with the WebinoDraw Manipulator |
||
89 | * |
||
90 | * @param HelperInterface $helper |
||
91 | */ |
||
92 | public function injectManipulator(HelperInterface $helper) |
||
104 | |||
105 | /** |
||
106 | * Inject a helper instance with the WebinoDraw VarTranslator |
||
107 | * |
||
108 | * @param HelperInterface $helper |
||
109 | */ |
||
110 | public function injectVarTranslator(HelperInterface $helper) |
||
122 | |||
123 | /** |
||
124 | * Inject a helper instance with the WebinoDraw DrawCache |
||
125 | * |
||
126 | * @param HelperInterface $helper |
||
127 | */ |
||
128 | public function injectCache(HelperInterface $helper) |
||
140 | |||
141 | /** |
||
142 | * Validate the plugin |
||
143 | * |
||
144 | * Checks that the helper loaded is an instance of HelperInterface. |
||
145 | * |
||
146 | * @param mixed $plugin |
||
147 | * @throws Exception\InvalidHelperException if invalid |
||
148 | */ |
||
149 | public function validatePlugin($plugin) |
||
164 | } |
||
165 |