librette/confirmation-dialog

dev-master 2020-02-27 16:55 UTC

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');
		}
	}

}