Perforce Chronicle 2012.2/486814
API Documentation

P4Cms_Controller_Action_Helper_Redirector Class Reference

Enhances Redirector by providing minor tweaks (e.g. More...

Inheritance diagram for P4Cms_Controller_Action_Helper_Redirector:
P4Cms_Controller_Action_Helper_BrowserDisconnect

List of all members.

Public Member Functions

 preDispatch ()
 Automatically initialize redirector prior to dispatch.
 redirectAndExit ()
 Extended to do nothing if unit testing.

Static Public Attributes

static $unitTestEnabled = false
 Whether or not redirector is being used with unit tests and thus not exit (as that would break tests).

Protected Member Functions

 _redirect ($url)
 Extend parent object to not render the view for the original action if we're redirecting, as it won't be displayed.

Protected Attributes

 $_exit = false

Detailed Description

Enhances Redirector by providing minor tweaks (e.g.

not render original action if redirecting).

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Member Function Documentation

P4Cms_Controller_Action_Helper_Redirector::_redirect ( url) [protected]

Extend parent object to not render the view for the original action if we're redirecting, as it won't be displayed.

Parameters:
string$urlThe url to redirect to.
Returns:
void
    {
        parent::_redirect($url);

        $controller = $this->getActionController();
        if ($controller instanceof Zend_Controller_Action) {
            $controller->getHelper('ViewRenderer')->setNoRender();
        }
    }
P4Cms_Controller_Action_Helper_Redirector::preDispatch ( )

Automatically initialize redirector prior to dispatch.

    {
        // make the helper easier to access from the controller.
        $controller = $this->getActionController();
        if ($controller instanceof Zend_Controller_Action) {
            $controller->redirector = $this;
        }
        
        return parent::preDispatch();
    }
P4Cms_Controller_Action_Helper_Redirector::redirectAndExit ( )

Extended to do nothing if unit testing.

Returns:
void
    {
        if (!static::$unitTestEnabled) {
            parent::redirectAndExit();
        }
    }

Member Data Documentation

P4Cms_Controller_Action_Helper_Redirector::$_exit = false [protected]
P4Cms_Controller_Action_Helper_Redirector::$unitTestEnabled = false [static]

Whether or not redirector is being used with unit tests and thus not exit (as that would break tests).


The documentation for this class was generated from the following file: