PHPackages                             rurounize/zend-flash-noty-messenger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rurounize/zend-flash-noty-messenger

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rurounize/zend-flash-noty-messenger
===================================

View Helper for beautiful JS notifications.

3.0.0(7y ago)014CSSPHP &gt;=7.0

Since Mar 6Pushed 7y agoCompare

[ Source](https://github.com/elialejandro/zend-flash-noty-messenger)[ Packagist](https://packagist.org/packages/rurounize/zend-flash-noty-messenger)[ Docs](https://github.com/elialejandro)[ RSS](/packages/rurounize-zend-flash-noty-messenger/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (6)Used By (0)

Apple style notifications :)
============================

[](#apple-style-notifications-)

This version support Zend Framework 3 and Noty v3

View Helper for showing flash messages with help of **NOTY** plugin

[![Screenshot](https://raw.githubusercontent.com/elialejandro/zend-flash-noty-messenger/master/asset/screenshot.png)](https://raw.githubusercontent.com/elialejandro/zend-flash-noty-messenger/master/asset/screenshot.png)

**Install**
-----------

[](#install)

Add in composer.json file and than run **composer update**

```
{
  "require": {
    "rurounize/zend-flash-noty-messenger":"^3.0"
  }
}
```

The module should be registered in **config/modules.config.php** in Zend Framework 3

```
return [
    // ...
    'FlashNotyMessenger'
    // ...
]
```

**Note** FlashNotyMessenger includes local files and CDN assets, you can decide what to use.

After that, copy JS files from **vendor/rurounize/zend-flash-noty-messenger/asset/**
and put it on path **public/js/noty/**

```
mkdir public/js/noty/
# For develop
cp vendor/rurounize/zend-flash-noty-messenger/asset/noty.js public/js/noty/noty.js
# For production
cp vendor/rurounize/zend-flash-noty-messenger/asset/noty.min.js public/js/noty/noty.min.js
```

If you can use local assets copy CSS files from **vendor/rurounize/zend-flash-noty-messenger/asset/**
and put it on path **public/css/noty/**

```
mkdir public/css/noty/
# For develop
cp vendor/rurounize/zend-flash-noty-messenger/asset/noty.css public/css/noty/noty.css
# For production
cp vendor/rurounize/zend-flash-noty-messenger/asset/noty.min.css public/css/noty/noty.min.css
```

If you want to customize the configuration you can copy in ***config/autoload/global.php*** or ***config/autoload/local.php***

```
return [
    // ...
    'noty_config' => [
        'layout'    => 'topRight',
        'theme'     => 'mint',
        'closeWith' => ['click', 'button'],
        /* 'animation' => [
            'open'  => 'animated fadeInRight',
            'close' => 'animated fadeOutRight'
        ] */
    ],

    'noty_assets' => [
        'use'   => 'cdn', // local for local assets
        'cdn'   => [
            'css'   => 'https://cdnjs.cloudflare.com/ajax/libs/noty/3.1.4/noty.min.css',
            'js'    => 'https://cdnjs.cloudflare.com/ajax/libs/noty/3.1.4/noty.min.js',
        ],
        'local' => [
            'css'   => 'css/noty/noty.min.css',
            'js'    => 'js/noty/noty.min.js',
        ]
    ],
    // ...
];
```

Setup
-----

[](#setup)

In layout.phtml somewhere at the end trigger fire()

```
/**
 * The fire() method do
 *     Collect all messages from previous and current request
 *     clear current messages because we will show it
 *     add JS files
 *     add JS notifications
 */

```

**Use**
-------

[](#use)

Use it in any controller.
Add messages in your controller and the messages will be showed (in redirected request or current)

```
