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-2012 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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Uses
\global\Zend_Controller_Action_Helper_Abstract  
Version
$Id: FlashMessenger.php 24813 2012-05-22 16:49:24Z adamlundrigan $  

Properties

>VPropertyprotected\Zend_Controller_Action $_actionController = null
inherited
$_actionController
Inherited from: \Zend_Controller_Action_Helper_Abstract::$$_actionController
>VPropertyprotectedmixed $_frontController = null
Default valuenullDetails
Type
mixed
Inherited_from
\Zend_Controller_Action_Helper_Abstract::$$_frontController  
>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
methodpublicgetActionController() : \Zend_Controller_Action
inherited

Retrieve current action controller

Inherited from: \Zend_Controller_Action_Helper_Abstract::getActionController()
Returns
TypeDescription
\Zend_Controller_Action
methodpublicgetCurrentMessages( $namespace = null) : array

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

Parameters
NameTypeDescription
$namespace
Returns
TypeDescription
array
methodpublicgetFrontController() : \Zend_Controller_Front
inherited

Retrieve front controller instance

Inherited from: \Zend_Controller_Action_Helper_Abstract::getFrontController()
Returns
TypeDescription
\Zend_Controller_Front
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
methodpublicgetName() : string
inherited

getName()

Inherited from: \Zend_Controller_Action_Helper_Abstract::getName()
Returns
TypeDescription
string
methodpublicgetNamespace() : string

getNamespace() - return the current namepsace

Returns
TypeDescription
string
methodpublicgetRequest() : \Zend_Controller_Request_Abstract
inherited

getRequest() -

Inherited from: \Zend_Controller_Action_Helper_Abstract::getRequest()
Returns
TypeDescription
\Zend_Controller_Request_Abstract$request
methodpublicgetResponse() : \Zend_Controller_Response_Abstract
inherited

getResponse() -

Inherited from: \Zend_Controller_Action_Helper_Abstract::getResponse()
Returns
TypeDescription
\Zend_Controller_Response_Abstract$response
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
methodpublicinit() : void
inherited

Hook into action controller initialization

Inherited from: \Zend_Controller_Action_Helper_Abstract::init()
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
methodpublicpreDispatch() : void
inherited

Hook into action controller preDispatch() workflow

Inherited from: \Zend_Controller_Action_Helper_Abstract::preDispatch()
methodpublicresetNamespace() : \Zend_Controller_Action_Helper_FlashMessenger

resetNamespace() - reset the namespace to the default

Returns
TypeDescription
\Zend_Controller_Action_Helper_FlashMessengerProvides a fluent interface
methodpublicsetActionController(\Zend_Controller_Action $actionController = null) : \Zend_Controller_ActionHelper_Abstract
inherited

setActionController()

Inherited from: \Zend_Controller_Action_Helper_Abstract::setActionController()
Parameters
NameTypeDescription
$actionController\Zend_Controller_Action
Returns
TypeDescription
\Zend_Controller_ActionHelper_AbstractProvides 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.0.0a12.