chomenko / confirm
Installs: 580
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:extensions
Requires
- php: >=7
- chomenko/extra-form: ^3.0
- chomenko/modal: ^3.0
- doctrine/annotations: ^1.6
- kdyby/events: ^3.1
This package is auto-updated.
Last update: 2025-03-15 19:46:15 UTC
README
Confirm modal from Nette Framework
Required
Install
composer require chomenko/confirm
- Configure kdyby/events
- Configure chomenko/extra-form
- Configure chomenko/modal
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 |