chomenko/confirm

There is no license information available for the latest version (v2.0.0) of this package.

Installs: 510

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:extensions

v2.0.0 2019-07-15 06:23 UTC

This package is auto-updated.

Last update: 2024-04-15 17:36:13 UTC


README

Confirm modal from Nette Framework

confirm

Required

Install

composer require chomenko/confirm

And then you should enable the extension using your neon config.

extensions:
	Confirm: Chomenko\Confirm\DI\ConfirmExtension

#optionally
Confirm:
	translator: Chomenko\Translator\Translator 

Usage

Use annotation @Confirm

in control:

<?php

//Your Presenter or Component

use Chomenko\Confirm\Confirm;

/**
 * @Confirm(
 *     question="You really want to delete this user?",
 *     type=Confirm::TYPE_DANGER
 * )
 *
 * @param int $userId
 * @throws \Nette\Application\AbortException
 */
public function handleRemoveUser(int $userId)
{
	//....
}

in latte:

<a n:href="RemoveUser!, userId => 1">Remove user</a>

Confirm options

Name Type
label string
question string
yes string
not string
type TYPE_DANGER
TYPE_SUCCESS
TYPE_WARNING
TYPE_INFO
TYPE_DEFAULT
translate bool
deniedDestination string (Presenter:actin)
translateFile string