Class FlashMessenger

Summary

Fully Qualified Name: Zend\Mvc\Plugin\FlashMessenger\FlashMessenger
Extends: AbstractPlugin
Implements: IteratorAggregate, Countable

Description

Flash Messenger - implement session-based messages

Methods

Name Description Defined By
addErrorMessage() Add a message with "error" type FlashMessenger
addInfoMessage() Add a message with "info" type FlashMessenger
addMessage() Add a message FlashMessenger
addSuccessMessage() Add a message with "success" type FlashMessenger
addWarningMessage() Add a message with "warning" type FlashMessenger
clearCurrentMessages() Clear messages from the current request and current namespace FlashMessenger
clearCurrentMessagesFromContainer() Clear messages from the container FlashMessenger
clearCurrentMessagesFromNamespace() Clear messages from the current namespace FlashMessenger
clearMessages() Clear all messages from the previous request & current namespace FlashMessenger
clearMessagesFromContainer() Clear all messages from the container FlashMessenger
clearMessagesFromNamespace() Clear all messages from specific namespace FlashMessenger
count() Complete the countable interface FlashMessenger
getContainer() Get session container for flash messages FlashMessenger
getController() Get the current controller instance AbstractPlugin
getCurrentErrorMessages() Get messages that have been added to the "error" namespace within this request FlashMessenger
getCurrentInfoMessages() Get messages that have been added to the "info" namespace within this request FlashMessenger
getCurrentMessages() Get messages that have been added to the current namespace within this request FlashMessenger
getCurrentMessagesFromNamespace() Get messages that have been added to the current namespace in specific namespace FlashMessenger
getCurrentSuccessMessages() Get messages that have been added to the "success" namespace within this request FlashMessenger
getCurrentWarningMessages() Get messages that have been added to the "warning" namespace within this request FlashMessenger
getErrorMessages() Get messages from "error" namespace FlashMessenger
getInfoMessages() Get messages from "info" namespace FlashMessenger
getIterator() Complete the IteratorAggregate interface, for iterating FlashMessenger
getMessages() Get messages from a specific namespace FlashMessenger
getMessagesFromNamespace() Get messages from a specific namespace FlashMessenger
getNamespace() Get the message namespace FlashMessenger
getSessionManager() Retrieve the session manager FlashMessenger
getSuccessMessages() Get messages from "success" namespace FlashMessenger
getWarningMessages() Get messages from "warning" namespace FlashMessenger
hasCurrentErrorMessages() Check to see if messages have been added to "error" namespace within this request FlashMessenger
hasCurrentInfoMessages() Check to see if messages have been added to "info" namespace within this request FlashMessenger
hasCurrentMessages() Check to see if messages have been added to the current namespace within this request FlashMessenger
hasCurrentSuccessMessages() Check to see if messages have been added to "success" namespace within this request FlashMessenger
hasCurrentWarningMessages() Check to see if messages have been added to "warning" namespace within this request FlashMessenger
hasErrorMessages() Whether "error" namespace has messages FlashMessenger
hasInfoMessages() Whether "info" namespace has messages FlashMessenger
hasMessages() Whether a specific namespace has messages FlashMessenger
hasSuccessMessages() Whether "success" namespace has messages FlashMessenger
hasWarningMessages() Whether "warning" namespace has messages FlashMessenger
setController() Set the current controller instance AbstractPlugin
setNamespace() Change the namespace messages are added to FlashMessenger
setSessionManager() Set the session manager FlashMessenger

Method Details

addErrorMessage()

Add a message with "error" type

Parameter Name Type Description
$message string

Returns: \FlashMessenger

addInfoMessage()

Add a message with "info" type

Parameter Name Type Description
$message string

Returns: \FlashMessenger

addMessage()

Add a message

Parameter Name Type Description
$message string
$namespace null|string
$hops null|int

Returns: \FlashMessenger Provides a fluent interface

addSuccessMessage()

Add a message with "success" type

Parameter Name Type Description
$message string

Returns: \FlashMessenger

addWarningMessage()

Add a message with "warning" type

Parameter Name Type Description
$message string

Returns: \FlashMessenger

clearCurrentMessages()

Clear messages from the current request and current namespace

Parameter Name Type Description
$namespace string

Returns: bool True if current messages were cleared, false if none existed.

clearCurrentMessagesFromContainer()

Clear messages from the container

Returns: bool True if current messages were cleared from the container, false if none existed.

clearCurrentMessagesFromNamespace()

Clear messages from the current namespace

Parameter Name Type Description
$namespaceToClear string

Returns: bool True if current messages were cleared from the given namespace, false if none existed.

clearMessages()

Clear all messages from the previous request & current namespace

Parameter Name Type Description
$namespace string

Returns: bool True if messages were cleared, false if none existed

clearMessagesFromContainer()

Clear all messages from the container

Returns: bool True if messages were cleared, false if none existed

clearMessagesFromNamespace()

Clear all messages from specific namespace

Parameter Name Type Description
$namespaceToClear string

Returns: bool True if messages were cleared, false if none existed

count()

Complete the countable interface

Returns: int

getContainer()

Get session container for flash messages

Returns: \Container

getController()

Get the current controller instance

Returns: null|\Dispatchable

getCurrentErrorMessages()

Get messages that have been added to the "error" namespace within this request

Returns: array

getCurrentInfoMessages()

Get messages that have been added to the "info" namespace within this request

Returns: array

getCurrentMessages()

Get messages that have been added to the current namespace within this request

Parameter Name Type Description
$namespace string

Returns: array

getCurrentMessagesFromNamespace()

Get messages that have been added to the current namespace in specific namespace

Parameter Name Type Description
$namespaceToGet string

Returns: array

getCurrentSuccessMessages()

Get messages that have been added to the "success" namespace within this request

Returns: array

getCurrentWarningMessages()

Get messages that have been added to the "warning" namespace within this request

Returns: array

getErrorMessages()

Get messages from "error" namespace

Returns: array

getInfoMessages()

Get messages from "info" namespace

Returns: array

getIterator()

Complete the IteratorAggregate interface, for iterating

Returns: \ArrayIterator

getMessages()

Get messages from a specific namespace

Parameter Name Type Description
$namespace string

Returns: array

getMessagesFromNamespace()

Get messages from a specific namespace

Parameter Name Type Description
$namespaceToGet string

Returns: array

getNamespace()

Get the message namespace

Returns: string

getSessionManager()

Retrieve the session manager

If none composed, lazy-loads a SessionManager instance

Returns: \Manager

getSuccessMessages()

Get messages from "success" namespace

Returns: array

getWarningMessages()

Get messages from "warning" namespace

Returns: array

hasCurrentErrorMessages()

Check to see if messages have been added to "error" namespace within this request

Returns: bool

hasCurrentInfoMessages()

Check to see if messages have been added to "info" namespace within this request

Returns: bool

hasCurrentMessages()

Check to see if messages have been added to the current namespace within this request

Parameter Name Type Description
$namespace string

Returns: bool

hasCurrentSuccessMessages()

Check to see if messages have been added to "success" namespace within this request

Returns: bool

hasCurrentWarningMessages()

Check to see if messages have been added to "warning" namespace within this request

Returns: bool

hasErrorMessages()

Whether "error" namespace has messages

Returns: bool

hasInfoMessages()

Whether "info" namespace has messages

Returns: bool

hasMessages()

Whether a specific namespace has messages

Parameter Name Type Description
$namespace string

Returns: bool

hasSuccessMessages()

Whether "success" namespace has messages

Returns: bool

hasWarningMessages()

Whether "warning" namespace has messages

Returns: bool

setController()

Set the current controller instance

Parameter Name Type Description
$controller \Dispatchable

Returns: void

setNamespace()

Change the namespace messages are added to

Useful for per action controller messaging between requests

Parameter Name Type Description
$namespace string

Returns: \FlashMessenger Provides a fluent interface

setSessionManager()

Set the session manager

Parameter Name Type Description
$manager \Manager

Returns: \FlashMessenger

Top