| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace Atk4\Ui\Form\Layout; |
| 6: | |
| 7: | use Atk4\Ui\Form; |
| 8: | use Atk4\Ui\View; |
| 9: | |
| 10: | /** |
| 11: | * Form generic layout section. |
| 12: | */ |
| 13: | class Section extends View |
| 14: | { |
| 15: | /** @var class-string<Form\Layout> */ |
| 16: | public $formLayout = Form\Layout::class; |
| 17: | |
| 18: | public Form $form; |
| 19: | |
| 20: | /** |
| 21: | * Adds sub-layout in existing layout. |
| 22: | * |
| 23: | * @return Form\Layout |
| 24: | */ |
| 25: | public function addSection() |
| 26: | { |
| 27: | return $this->add([$this->formLayout, 'form' => $this->form]); |
| 28: | } |
| 29: | } |
| 30: |