librette/confirmation-dialog

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

This package is auto-updated.

Last update: 2024-03-28 02:30:03 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');
		}
	}

}