geniv/nette-flash-message

Flash message component for Nette Framework

v1.0.8 2018-12-17 16:56 UTC

This package is auto-updated.

Last update: 2024-11-18 06:37:55 UTC


README

Installation

$ composer require geniv/nette-flash-message

or

"geniv/nette-flash-message": "^1.0"

require:

"php": ">=7.0",
"nette/nette": ">=2.4",
"geniv/nette-general-form": ">=1.0"

Include in application

neon configure:

...
events:
    - AjaxFlashMessageEvent
#    - AjaxFlashMessageEvent(otherNameComponent)
#    - AjaxFlashMessageEvent(otherNameComponent, otherFallBack)

neon configure services:

services:
    - FlashMessage

usage:

protected function createComponentFlashMessage(IFlashMessage $flashMessage): IFlashMessage
{
    // $flashMessage->setTemplatePath(__DIR__ . '/templates/FlashMessage.latte');
    // $flashMessage->setAliasType(['danger' => 'error',]);
    return $flashMessage;
}

call in callback:

$this['flashMessage']->redraw();

$this['flashMessage']->redraw($fallBack = 'this');

for method setTemplatePath() is possible use predefined latte: FlashMessage::SWAL_PATH or FlashMessage::NETTE_PATH

usage:

{control flashMessage}