Controller/Action/Helper/FlashMessenger.php

Show: inherited
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 [email protected] 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

Propertyprotected\Zend_Controller_Action $_actionController = null
inherited

$_actionController

Inherited from: \Zend_Controller_Action_Helper_Abstract::$$_actionController
Propertyprotectedmixed $_frontController = null
Default valuenullDetails
Type
mixed
Inherited_from
\Zend_Controller_Action_Helper_Abstract::$$_frontController  
Propertyprotectedboolean $_messageAdded = false
static

$_messageAdded - Wether a message has been previously added

Default valuefalseDetails
Type
boolean
Propertyprotectedarray $_messages = array()
static

$_messages - Messages from previous request

Default valuearray()Details
Type
array
Propertyprotectedstring $_namespace = 'default'

$_namespace - Instance namespace, default is 'default'

Default value'default'Details
Type
string
Propertyprotected\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
Name Type Description
$message string
$namespace
Returns
Type Description
\Zend_Controller_Action_Helper_FlashMessenger Provides a fluent interface
methodpublicclearCurrentMessages( $namespace = null) : boolean

clear messages from the current request & current namespace

Parameters
Name Type Description
$namespace
Returns
Type Description
boolean
methodpublicclearMessages( $namespace = null) : boolean

Clear all messages from the previous request & current namespace

Parameters
Name Type Description
$namespace
Returns
Type Description
boolean True if messages were cleared, false if none existed
methodpubliccount( $namespace = null) : int

count() - Complete the countable interface

Parameters
Name Type Description
$namespace
Returns
Type Description
int
methodpublicdirect(string $message,  $namespace = NULL) : void

Strategy pattern: proxy to addMessage()

Parameters
Name Type Description
$message string
$namespace
methodpublicgetActionController() : \Zend_Controller_Action
inherited

Retrieve current action controller

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

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

Parameters
Name Type Description
$namespace
Returns
Type Description
array
methodpublicgetFrontController() : \Zend_Controller_Front
inherited

Retrieve front controller instance

Inherited from: \Zend_Controller_Action_Helper_Abstract::getFrontController()
Returns
Type Description
\Zend_Controller_Front
methodpublicgetIterator( $namespace = null) : \ArrayObject

getIterator() - complete the IteratorAggregate interface, for iterating

Parameters
Name Type Description
$namespace
Returns
Type Description
\ArrayObject
methodpublicgetMessages( $namespace = null) : array

getMessages() - Get messages from a specific namespace

Parameters
Name Type Description
$namespace
Returns
Type Description
array
methodpublicgetName() : string
inherited

getName()

Inherited from: \Zend_Controller_Action_Helper_Abstract::getName()
Returns
Type Description
string
methodpublicgetNamespace() : string

getNamespace() - return the current namepsace

Returns
Type Description
string
methodpublicgetRequest() : \Zend_Controller_Request_Abstract
inherited

getRequest() -

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

getResponse() -

Inherited from: \Zend_Controller_Action_Helper_Abstract::getResponse()
Returns
Type Description
\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
Name Type Description
$namespace
Returns
Type Description
boolean
methodpublichasMessages( $namespace = null) : boolean

hasMessages() - Wether a specific namespace has messages

Parameters
Name Type Description
$namespace
Returns
Type Description
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
Type Description
\Zend_Controller_Action_Helper_FlashMessenger Provides 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
Type Description
\Zend_Controller_Action_Helper_FlashMessenger Provides a fluent interface
methodpublicsetActionController(\Zend_Controller_Action $actionController = null) : \Zend_Controller_ActionHelper_Abstract
inherited

setActionController()

Inherited from: \Zend_Controller_Action_Helper_Abstract::setActionController()
Parameters
Name Type Description
$actionController \Zend_Controller_Action
Returns
Type Description
\Zend_Controller_ActionHelper_Abstract Provides 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
Name Type Description
$namespace string
Returns
Type Description
\Zend_Controller_Action_Helper_FlashMessenger Provides a fluent interface
Documentation was generated by phpDocumentor 2.0.0a8.