2017 © Pedro Peláez
 

library zf2-flash-noty-messenger

View Helper for beautiful JS notifications.

image

tasmaniski/zf2-flash-noty-messenger

View Helper for beautiful JS notifications.

  • Thursday, April 13, 2017
  • by tasmaniski
  • Repository
  • 2 Watchers
  • 8 Stars
  • 166 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Apple style notifications :)

New version is here! Current version support Zend Framework 3, (*1)

View Helper for showing flash messages with help of NOTY jQuery plugin http://ned.im/noty/#/about br/ You must include the latest release of jQuery and Bootstrap. br/ br/, (*2)

alt tag, (*3)

Install

Add in composer.json file and than run composer update, (*4)

"require": {
    "tasmaniski/zend-flash-noty-messenger":"^2.0"
}

The module should be registered in config/application.config.php, (*5)

'modules' => array(
    '...',
    'FlashNotyMessenger'
),

After that, copy 2 JS files from vendor/tasmaniski/zend-flash-noty-messenger/asset/ br/ and put it on path public/js/noty/ br/, (*6)


mkdir public/js/noty/ cp vendor/tasmaniski/zend-flash-noty-messenger/asset/jquery.noty.packaged.js public/js/noty/jquery.noty.packaged.js cp vendor/tasmaniski/zend-flash-noty-messenger/asset/jquery.noty.config.js public/js/noty/jquery.noty.config.js

br/, (*7)

Setup

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


/** * 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 */ flashNoty()->fire(); ?> inlineScript() ?>

Example from my code, (*9)

//  at the end of layout.phtml

/* fire all messages */
flashNoty()->fire(); ?>


inlineScript()  // we call here inlineScript()
    ->appendFile($this->basePath('js/jquery.js'))
    ->appendFile($this->basePath('js/bootstrap.js')); ?>

Note: if you want to use it in ZF2 app, add in composer.json version ^1.0, (*10)

Use

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

<?php
$this->flashMessenger()->addSuccessMessage('Success message, bravo!');
$this->flashMessenger()->addErrorMessage('Error with system, contact us.');
$this->flashMessenger()->addInfoMessage('Info message, to do whatever...');
$this->flashMessenger()->addWarningMessage('Warning message to be careful.');

Credits

I would like to give a credit to my colleague https://github.com/maksi80 for CSS style of notifications., (*12)

The Versions

13/04 2017

dev-master

9999999-dev https://github.com/tasmaniski

View Helper for beautiful JS notifications.

  Sources   Download

The Requires

 

by Aleksandar Varnicic

zend framework notifications js-noty

13/04 2017

2.0.2

2.0.2.0 https://github.com/tasmaniski

View Helper for beautiful JS notifications.

  Sources   Download

The Requires

 

by Aleksandar Varnicic

zend framework notifications js-noty

12/10 2016

2.0.1

2.0.1.0 https://github.com/tasmaniski

View Helper for beautiful JS notifications.

  Sources   Download

The Requires

 

by Aleksandar Varnicic

zend framework notifications js-noty

12/10 2016

2.0.0

2.0.0.0 https://github.com/tasmaniski

View Helper for beautiful JS notifications.

  Sources   Download

The Requires

 

by Aleksandar Varnicic

zend framework notifications js-noty

06/03 2016

1.0.0

1.0.0.0 https://github.com/tasmaniski

View Helper for beautiful JS notifications.

  Sources   Download

The Requires

 

by Aleksandar Varnicic

zf2 notifications js-noty