| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace Atk4\Ui; |
| 6: | |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | class AccordionSection extends View |
| 13: | { |
| 14: | public $defaultTemplate = 'accordion-section.html'; |
| 15: | |
| 16: | |
| 17: | public $title; |
| 18: | |
| 19: | |
| 20: | public $virtualPage; |
| 21: | |
| 22: | |
| 23: | public $icon = 'dropdown'; |
| 24: | |
| 25: | #[\Override] |
| 26: | protected function renderView(): void |
| 27: | { |
| 28: | parent::renderView(); |
| 29: | |
| 30: | $this->template->set('icon', $this->icon); |
| 31: | |
| 32: | if ($this->title) { |
| 33: | $this->template->set('title', $this->title); |
| 34: | } |
| 35: | |
| 36: | if ($this->virtualPage) { |
| 37: | $this->template->set('itemId', $this->virtualPage->name); |
| 38: | $this->template->set('path', $this->virtualPage->getJsUrl('cut')); |
| 39: | } else { |
| 40: | |
| 41: | $this->template->set('itemId', $this->name . '-vp-unused'); |
| 42: | } |
| 43: | } |
| 44: | } |
| 45: | |