| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace Atk4\Ui; |
| 6: | |
| 7: | class MenuItem extends View |
| 8: | { |
| 9: | /** @var string Specify a label for this menu item. */ |
| 10: | public $label; |
| 11: | |
| 12: | /** @var string Specify icon for this menu item. */ |
| 13: | public $icon; |
| 14: | |
| 15: | #[\Override] |
| 16: | protected function renderView(): void |
| 17: | { |
| 18: | if ($this->label) { |
| 19: | Label::addTo($this, [$this->label]); |
| 20: | } |
| 21: | |
| 22: | if ($this->icon) { |
| 23: | Icon::addTo($this, [$this->icon]); |
| 24: | } |
| 25: | |
| 26: | parent::renderView(); |
| 27: | } |
| 28: | } |
| 29: |