1 | <?php |
||
20 | class SlotViewHelperService implements SingletonInterface |
||
21 | { |
||
22 | /** |
||
23 | * Contains the closures which will render the registered slots. The keys |
||
24 | * of this array are the names of the slots. |
||
25 | * |
||
26 | * @var Closure[] |
||
27 | */ |
||
28 | private $closures = []; |
||
29 | |||
30 | /** |
||
31 | * @var array[] |
||
32 | */ |
||
33 | private $arguments = []; |
||
34 | |||
35 | /** |
||
36 | * Adds a closure - which will render the slot with the given name - to the |
||
37 | * private storage in this class. |
||
38 | * |
||
39 | * @param string $name |
||
40 | * @param Closure $closure |
||
41 | * @param array $arguments |
||
42 | */ |
||
43 | public function addSlot($name, Closure $closure, array $arguments) |
||
48 | |||
49 | /** |
||
50 | * Returns the closure which will render the slot with the given name. |
||
51 | * |
||
52 | * @param string $name |
||
53 | * @return Closure |
||
54 | * @throws EntryNotFoundException |
||
55 | */ |
||
56 | public function getSlotClosure($name) |
||
64 | |||
65 | /** |
||
66 | * Returns the closure which will render the slot with the given name. |
||
67 | * |
||
68 | * @param string $name |
||
69 | * @return array |
||
70 | * @throws EntryNotFoundException |
||
71 | */ |
||
72 | public function getSlotArguments($name) |
||
80 | |||
81 | /** |
||
82 | * @param string $name |
||
83 | * @return bool |
||
84 | */ |
||
85 | public function hasSlot($name) |
||
89 | |||
90 | /** |
||
91 | * Resets the list of closures. |
||
92 | */ |
||
93 | public function resetState() |
||
98 | } |
||
99 |