Settings.php
47 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Admin\Page; |
| 6 | |
| 7 | use AC\Admin\Asset\Script\SettingsFactory; |
| 8 | use AC\Admin\RenderableHead; |
| 9 | use AC\Asset\Assets; |
| 10 | use AC\Asset\Enqueueables; |
| 11 | use AC\Renderable; |
| 12 | |
| 13 | class Settings implements Enqueueables, Renderable, RenderableHead |
| 14 | { |
| 15 | public const NAME = 'settings'; |
| 16 | |
| 17 | private Renderable $head; |
| 18 | |
| 19 | private SettingsFactory $settings_factory; |
| 20 | |
| 21 | public function __construct( |
| 22 | Renderable $head, |
| 23 | SettingsFactory $settings_factory |
| 24 | ) { |
| 25 | $this->head = $head; |
| 26 | $this->settings_factory = $settings_factory; |
| 27 | } |
| 28 | |
| 29 | public function render_head(): Renderable |
| 30 | { |
| 31 | return $this->head; |
| 32 | } |
| 33 | |
| 34 | public function get_assets(): Assets |
| 35 | { |
| 36 | return new Assets([ |
| 37 | $this->settings_factory->create(), |
| 38 | ]); |
| 39 | } |
| 40 | |
| 41 | public function render(): string |
| 42 | { |
| 43 | return ''; |
| 44 | } |
| 45 | |
| 46 | } |
| 47 |