Skip to content
ronaldbaltus edited this page Mar 4, 2013 · 2 revisions

The sxbFlashMessenger displays a message trough the controller and combines them when the type is the same . Unlike the [sxbAlert] (https://github.com/RWOverdijk/SxBootstrap/wiki/Alert), the sxbFlashMessenger gets called trough the controller.

<?php
$this->sxbFlashMessenger($namespace);
$this->sxbFlashMessenger(array($namespace1, $namespace2));
?>

Parameters

<?php
// namespace, isBlock
$this->sxbFlashMessenger($namespace, $isBlock);
?>

Explicit usage in controller

<?php
$this->flashMessenger()->addSuccessMessage('This is a notice');
?>

Message types

  • addInfoMessage
  • addSuccesstMessage
  • addWarningMessage
  • addErrorMessage

If you want to use the addWarningMessage() you'll need to overide the default flashMessenger:

'controller_plugins' => array(
    'invokables' => array(
        'flashMessenger' => 'SxBootstrap\Controller\Plugin\FlashMessenger'
    )
 ),

Needed in your view

<?php 
echo $this->sxbFlashMessenger(); 
?>

Clone this wiki locally