2017 © Pedro PelĂĄez
 

module zf-super-messenger

ZF3 module v1.1 - Boost your FlashMessenger !

image

mb-tec/zf-super-messenger

ZF3 module v1.1 - Boost your FlashMessenger !

  • Sunday, October 23, 2016
  • by Nite74
  • Repository
  • 1 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ZF2 SuperMessenger module

Version 1.1 Created by Matthias BĂźsing, (*1)

/!\ This module is now a PR to Zend Framework 3 : https://github.com/zendframework/zf2/pull/3502. Give me your feedback !, (*2)

Introduction

ZF3 SuperMessenger module provide new features for plugin FlashMessenger. Now, you can add directly 3 level of messages : success message, error message or info message., (*3)

Usage

• Usage in controller :, (*4)

$this->flashMessenger()->addInfoMessage('bar-info');
$this->flashMessenger()->addSuccessMessage('bar-success');
$this->flashMessenger()->addErrorMessage('bar-error');

Just active the module and the FlashMessenger will have features without BC ! You can use SuperMessenger by the identifier "FlashMessenger" with the alias. You could use the identifier "SuperMessenger" to pilot the plugin., (*5)

• Usage in view :, (*6)

And to be complete, there is a view helper. Usage in a view to get list of messages :, (*7)

<?php
    $infoMessages = $this->flashMessenger('info');
?>

You can directly have a render of the messages :, (*8)

<?php
    echo $this->flashMessenger()->render('info');
?>

By default, the format is :, (*9)

<ul class="info">
    <li>first message</li>
    <li>second message</li>
</ul>

You can change the format, like this :, (*10)

<?php
    echo $this->flashMessenger()
                ->setMessageOpenFormat('<div%s><p>')
                ->setMessageSeparatorString('</p><p>')
                ->setMessageCloseString('</p></div>')
                ->render('info');
?>

Format could be changed in supermessenger.local.php which will be moved in "/config/autoload" :, (*11)

'view_helper' => array(
    'supermessenger' => array(
        'message_open_format' => '<div%s><ul><li>',
        'message_separator_string' => '</li><li>',
        'message_close_string' => '</li></ul></div>',
    ),
),

You can change easily the class CSS with :, (*12)

<?php
    echo $this->flashMessenger()->render('info', array('foo-baz', 'foo-bar'));
?>
<ul class="foo-baz foo-bar">
    <li>first message</li>
    <li>second message</li>
</ul>

The Versions

23/10 2016

dev-master

9999999-dev https://github.com/blanchonvincent/SuperMessenger

ZF3 module v1.1 - Boost your FlashMessenger !

  Sources   Download

MIT

The Requires

 

23/10 2016

1.1

1.1.0.0 https://github.com/blanchonvincent/SuperMessenger

ZF3 module v1.1 - Boost your FlashMessenger !

  Sources   Download

MIT

The Requires