zenify/flash-message-component

Flash message component for Nette

Installs: 1 302

Dependents: 0

Stars: 3

Watchers: 1

Forks: 2

Language: PHP

v4.0.1 2015-03-12 09:36 UTC

README

Build Status Quality Score Code Coverage Downloads this Month Latest stable

This extension simplifies use of flash messages in templates just to {control flashMessage}: Also includes translator support and css class prefix.

Install

Via Composer:

$ composer require zenify/flash-message-component

And register extension in config.neon:

extensions:
    - Zenify\FlashMessageComponent\DI\FlashMessageExtension

Usage

Inject to presenter

class Presenter ...
{

    /**
     * @inject
     * @var Zenify\FlashMessageComponent\FlashMessageControlFactory
     */
    public $flashMessageControlFactory;


    /**
     * @return Zenify\FlashMessageComponent\FlashMessageControl
     */
    public function createComponentFlashMessage()
    {
        return $this->flashMessageControlFactory->create();
    }

}

Render in template

{control flashMessage}