Controller/Action/Helper/FlashMessenger.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Controller  
Subpackage
Zend_Controller_Action_Helper  

\Zend_Controller_Action_Helper_FlashMessenger

Package: Zend_Controller\Zend_Controller_Action_Helper
Flash Messenger - implement session-based messages
Implements
Parent(s)
\Zend_Controller_Action_Helper_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Uses
 
Version
$Id$  

Properties

>VPropertyprotectedboolean $_messageAdded = false
static
$_messageAdded - Wether a message has been previously added
Default valuefalseDetails
Type
boolean
>VPropertyprotectedarray $_messages = array()
static
$_messages - Messages from previous request
Default valuearray()Details
Type
array
>VPropertyprotectedstring $_namespace = 'default'
$_namespace - Instance namespace, default is 'default'
Default value'default'Details
Type
string
>VPropertyprotected\Zend_Session $_session = null
static
$_session - Zend_Session storage object
Default valuenullDetails
Type
\Zend_Session

Methods

methodpublic__construct() : void

__construct() - Instance constructor, needed to get iterators, etc

methodpublicaddMessage(string $message,  $namespace = null) : \Zend_Controller_Action_Helper_FlashMessenger

addMessage() - Add a message to flash message

Parameters
NameTypeDescription
$messagestring
$namespace
Returns
TypeDescription
\Zend_Controller_Action_Helper_FlashMessengerProvides a fluent interface
methodpublicclearCurrentMessages( $namespace = null) : boolean

clear messages from the current request & current namespace

Parameters
NameTypeDescription
$namespace
Returns
TypeDescription
boolean
methodpublicclearMessages( $namespace = null) : boolean

Clear all messages from the previous request & current namespace

Parameters
NameTypeDescription
$namespace
Returns
TypeDescription
booleanTrue if messages were cleared, false if none existed
methodpubliccount( $namespace = null) : int

count() - Complete the countable interface

Parameters
NameTypeDescription
$namespace
Returns
TypeDescription
int
methodpublicdirect(string $message,  $namespace = NULL) : void

Strategy pattern: proxy to addMessage()

Parameters
NameTypeDescription
$messagestring
$namespace
methodpublicgetCurrentMessages( $namespace = null) : array

getCurrentMessages() - get messages that have been added to the current namespace within this request

Parameters
NameTypeDescription
$namespace
Returns
TypeDescription
array
methodpublicgetIterator( $namespace = null) : \ArrayObject

getIterator() - complete the IteratorAggregate interface, for iterating

Parameters
NameTypeDescription
$namespace
Returns
TypeDescription
\ArrayObject
methodpublicgetMessages( $namespace = null) : array

getMessages() - Get messages from a specific namespace

Parameters
NameTypeDescription
$namespace
Returns
TypeDescription
array
methodpublicgetNamespace() : string

getNamespace() - return the current namepsace

Returns
TypeDescription
string
methodpublichasCurrentMessages( $namespace = null) : boolean

hasCurrentMessages() - check to see if messages have been added to current namespace within this request

Parameters
NameTypeDescription
$namespace
Returns
TypeDescription
boolean
methodpublichasMessages( $namespace = null) : boolean

hasMessages() - Wether a specific namespace has messages

Parameters
NameTypeDescription
$namespace
Returns
TypeDescription
boolean
methodpublicpostDispatch() : \Zend_Controller_Action_Helper_FlashMessenger

postDispatch() - runs after action is dispatched, in this case, it is resetting the namespace in case we have forwarded to a different action, Flashmessage will be 'clean' (default namespace)

Returns
TypeDescription
\Zend_Controller_Action_Helper_FlashMessengerProvides a fluent interface
methodpublicresetNamespace() : \Zend_Controller_Action_Helper_FlashMessenger

resetNamespace() - reset the namespace to the default

Returns
TypeDescription
\Zend_Controller_Action_Helper_FlashMessengerProvides a fluent interface
methodpublicsetNamespace(string $namespace = 'default') : \Zend_Controller_Action_Helper_FlashMessenger

setNamespace() - change the namespace messages are added to, useful for per action controller messaging between requests

Parameters
NameTypeDescription
$namespacestring
Returns
TypeDescription
\Zend_Controller_Action_Helper_FlashMessengerProvides a fluent interface
Documentation was generated by phpDocumentor 2.2.0 .