| 1 | <?php |
||
| 18 | class SlotViewHelperService implements SingletonInterface |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * Contains the closures which will render the registered slots. The keys |
||
| 22 | * of this array are the names of the slots. |
||
| 23 | * |
||
| 24 | * @var callable[] |
||
| 25 | */ |
||
| 26 | private $slots = []; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Adds a closure - which will render the slot with the given name - to the |
||
| 30 | * private storage in this class. |
||
| 31 | * |
||
| 32 | * @param string $name |
||
| 33 | * @param callable $closure |
||
| 34 | */ |
||
| 35 | public function addSlotClosure($name, $closure) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Returns the closure which will render the slot with the given name. If |
||
| 42 | * nothing is found, `null` is returned. |
||
| 43 | * |
||
| 44 | * @param string $name |
||
| 45 | * @return callable|null |
||
| 46 | */ |
||
| 47 | public function getSlotClosure($name) |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Resets the list of closures. |
||
| 56 | */ |
||
| 57 | public function resetState() |
||
| 61 | } |
||
| 62 |