occ2 / flashes
Extra contribute of Nette Application flash messages with Bootstrap4 alert style
v1.1.0
2018-09-05 19:40 UTC
Requires
- php: >=7.0.0
- nette/application: ^2.4
This package is not auto-updated.
Last update: 2024-11-08 07:41:19 UTC
README
This package is extra contrib of nette/application flash messages. It use Twitter Bootstrap4 styles (alert). If you need use it please move flashes.latte into your application template directory (or your Control template directory)
Installation:
composer require occ2/flashes
Usage:
In presenter
<?php
namespace MyApp\Presenters;
use Nette\Application\UI\Presenter
class MyPresenter extends Presenter{
use TFlashMessage;
public function handleSomething(){
... // some code
$this->flashMessage("Error message","danger", "some comment of message", "fa fas-cross", 75, "xl", 10);
if($this->isAjax(){
$this->redrawControl();
}
else{
$this->redirect("this");
}
}
}
Params of flashMessage() function
- $message - alert title
- $type - alert type (success, primary, info, warning, danger)
- $comment - comment of message
- $icon - icon class (for example from Font Awesome)
- $width - alert width (relative - may be 25,50,75,100)
- $size - icon size prefix (may be xs, sm, lg, xl)
- $delay - number of seconds to autohide flash message