librette / confirmation-dialog
dev-master
2020-02-27 16:55 UTC
Requires
- php: >=7.1
- nette/application: ~3.0
- nette/di: ~3.0
- nette/forms: ~3.0
- nette/utils: ~3.0
Requires (Dev)
- nette/tester: @dev
- phpstan/phpstan: ^0.12.11
This package is auto-updated.
Last update: 2024-11-28 03:53:27 UTC
README
The best way to install this extension is using Composer:
$ composer require librette/confirmation-dialog
Usage
You can use confirmation dialog in handle* methods in presenters and controls.
class ArticleControl extends Control { use Librette\ConfirmationDialog\TConfirmation; public function handleRemove($id) { $article = $this->articleRepository->get($id); if($this->confirm("Do you really want to delete article {$article->title}?")) { $this->articleRepository->delete($article); $this->redirect('this'); } elseif($this->isConfirmationCancelled()) { $this->redirect('this'); } } }