1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace Atk4\Ui;
6:
7: class WizardStep extends View
8: {
9: public $ui = 'step';
10: public $defaultTemplate;
11:
12: /** @var string Title to display in the step. */
13: public $title;
14:
15: /** @var string Description to show in the step under the title. */
16: public $description;
17:
18: /** @var Wizard Link back to the wizard object. */
19: public $wizard;
20:
21: /** @var string|false Icon appears to the left of the title in the step. You can disable icons for entire wizard. */
22: public $icon;
23:
24: /** @var int Will be automatically assigned 0, 1, 2, etc,. */
25: public $sequence;
26:
27: /**
28: * @param string $title
29: */
30: public function __construct($title)
31: {
32: parent::__construct(['title' => $title]);
33: }
34:
35: #[\Override]
36: protected function renderView(): void
37: {
38: $this->template->set('title', $this->title);
39: $this->template->set('description', $this->description);
40:
41: if ($this->icon === false) {
42: $this->template->del('hasIcon');
43: } else {
44: $this->template->set('icon', $this->icon);
45: }
46:
47: parent::renderView();
48: }
49: }
50: