diff --git a/.gitignore b/.gitignore index 88e99d5..94ef125 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ vendor -composer.lock \ No newline at end of file +composer.lock +version.json diff --git a/src/Interfaces/Modal.php b/src/Interfaces/Modal.php new file mode 100644 index 0000000..d5cfe65 --- /dev/null +++ b/src/Interfaces/Modal.php @@ -0,0 +1,16 @@ +getComponent($modal, true); + } + + if ($modal instanceof Modal) { + if ($modal instanceof EventHandler && $modal->isWatched('render')) { + $modal->when('render', fn($m, $t) => $t->setParameters($params)); + $params = []; + } + + $modal->setModalOpen(true); + $modal = '#'.$modal->getName(); + } + + $template = $this->getTemplate(); + $template->add('openModal', $modal); + $template->setParameters($params); + + $this->redrawControl('modals'); + $this->redirect('this'); + } +}