PHP code example of mb-tec / zf-super-messenger

1. Go to this page and download the library: Download mb-tec/zf-super-messenger library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mb-tec / zf-super-messenger example snippets


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


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


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

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


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

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


    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>