Controller: Action

author Barry O'Donovan
author The Skilled Team of PHP Developers at Open Solutions
link Online documentation
category OSS
package OSS_Controller
copyright Copyright (c) 2007 - 2013, Open Source Solutions Limited, Dublin, Ireland
license New BSD License

 Methods

Override the Zend_Controller_Action's constructor (which is called at the very beginning of this function anyway).

__construct(\Zend_Controller_Request_Abstract $request, \Zend_Controller_Response_Abstract $response, array $invokeArgs) 

Parameters

$request

object

See Parent class constructer

$response

object

See Parent class constructer

$invokeArgs

object

See Parent class constructer

Get the application options associative array

getOptions() : array
Inherited
inherited_from \OSS_Controller_Action::getOptions()

Returns

arrayThe options array

A utility method to get a named resource.

getResource(string $resource) : \Zend_Application_Resource_ResourceAbstract
Inherited
inherited_from \OSS_Controller_Action::getResource()

Parameters

$resource

string

Returns

\Zend_Application_Resource_ResourceAbstract

Wrapper function for Zend's _redirect() to **ensure** we end execution after the redirection.

redirectAndEnsureDie(string $where, string $from) : void
Inherited
inherited_from \OSS_Controller_Action::redirectAndEnsureDie()

Parameters

$where

string

Defaults to '' - where to redirect to (e.g. controller/action/p1/v1/...)

$from

string

Where you redirected from for logging purposes. Defaults to requested controller/action.

Get the Zend application bootstrap

getBootstrap() : \Zend_Application_Bootstrap_Bootstrap
Inherited
inherited_from \OSS_Controller_Action::getBootstrap()

Returns

\Zend_Application_Bootstrap_Bootstrap

Set the Zend application bootstrap in this instance and in the global registry.

setBootstrap(\Zend_Application_Bootstrap_Bootstrap $bs) 
Inherited
inherited_from \OSS_Controller_Action::setBootstrap()

Parameters

$bs

\Zend_Application_Bootstrap_Bootstrap

If a named trait has been initialised, returns true, else false

traitIsInitialised(string $trait) : bool
Inherited
inherited_from \OSS_Controller_Action::traitIsInitialised()

Parameters

$trait

string

The name of the trait to check for

Returns

boolWhether the trait has been initialised or not

Mark a trait as initialised

traitSetInitialised(string $trait) 
Inherited
inherited_from \OSS_Controller_Action::traitSetInitialised()

Parameters

$trait

string

The name of the trait to check for

All declared traits can have their own initialisation method.

initialiseTraits(object $request, object $response, object $invokeArgs) 
Inherited

This function iterates over the declared traits and initialises them if necessary.

NB - order of initialisation is order of declaration

This function should be called from the contructor and it passes those same variables used for construction to the traits' init methods.

inherited_from \OSS_Controller_Action::initialiseTraits()

Parameters

$request

object

See Parent class constructor

$response

object

See Parent class constructor

$invokeArgs

object

See Parent class constructor

 Properties

 

A variable to hold an instance of the bootstrap object

$_bootstrap : \Zend_Application_Bootstrap_Bootstrap
Inherited
inherited_from \OSS_Controller_Action::$$_bootstrap
 

An array to hold the names of traits that have been initialised

$_initialisedTraits : array
Inherited

This can be used by other traits to check for dependancies.

inherited_from \OSS_Controller_Action::$$_initialisedTraits
 

<p>An array representation of the application.ini</p>

$_options : array
Inherited
inherited_from \OSS_Controller_Action::$$_options