Class Zend_Controller_Front

Description
  • license: New BSD License
  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)

Located in /Zend/Controller/Front.php (line 46)


	
			
Variable Summary
Method Summary
 static void run (string|array $controllerDirectory)
 Zend_Controller_Front clearParams ([null|string|array $name = null])
 string getBaseUrl ()
 string|array getControllerDirectory ()
 string getDefaultAction ()
 Zend_Controller_DispatcherInteface getDispatcher ()
 mixed getParam (string $name)
 array getParams ()
 void resetInstance ()
 boolean returnResponse ([boolean $flag = null])
 Zend_Controller_Front setBaseUrl ([string $base = null])
 Zend_Controller_Front setControllerDirectory (string|array $directory)
 Zend_Controller_Front setParam (string $name, mixed $value)
 boolean throwExceptions ([boolean $flag = null])
Variables
string $_baseUrl = null (line 52)

Base URL

  • access: protected
string|array $_controllerDir = null (line 59)

Directory|ies where controllers are stored

  • access: protected
Zend_Controller_Dispatcher_Interface $_dispatcher = null (line 65)

Instance of Zend_Controller_Dispatcher_Interface

  • access: protected
array $_invokeParams = array() (line 78)

Array of invocation parameters to use when instantiating action

controllers

  • access: protected
Zend_Controller_Plugin_Broker $_plugins = null (line 84)

Instance of Zend_Controller_Plugin_Broker

  • access: protected
Zend_Controller_Request_Abstract $_request = null (line 90)

Instance of Zend_Controller_Request_Abstract

  • access: protected
Zend_Controller_Response_Abstract $_response = null (line 96)

Instance of Zend_Controller_Response_Abstract

  • access: protected
boolean $_returnResponse = false (line 103)

Whether or not to return the response prior to rendering output while in dispatch(); default is to send headers and render output.

  • access: protected
Zend_Controller_Router_Interface $_router = null (line 109)

Instance of Zend_Controller_Router_Interface

  • access: protected
boolean $_throwExceptions = false (line 116)

Whether or not exceptions encountered in dispatch() should be

thrown or trapped in the response object

  • access: protected
Methods
static getInstance (line 138)

Singleton instance

  • access: public
static Zend_Controller_Front getInstance ()
static run (line 190)

Convenience feature, calls setControllerDirectory()->setRouter()->dispatch()

In PHP 5.1.x, a call to a static method never populates $this -- so run() may actually be called after setting up your front controller.

  • access: public
  • throws: Zend_Controller_Exception if called from an object instance
static void run (string|array $controllerDirectory)
  • string|array $controllerDirectory: Path to Zend_Controller_Action controller classes or array of such paths
addControllerDirectory (line 206)

Add a controller directory to the controller directory stack

  • access: public
Zend_Controller_Front addControllerDirectory (string $directory)
  • string $directory
clearParams (line 537)

Clear the controller parameter stack

By default, clears all parameters. If a parameter name is given, clears only that parameter; if an array of parameter names is provided, clears each.

  • access: public
Zend_Controller_Front clearParams ([null|string|array $name = null])
  • null|string|array $name: single key or array of keys for params to clear
dispatch (line 625)

Dispatch an HTTP request to a controller/action.

  • return: Returns response object if returnResponse() is true
  • access: public
getBaseUrl (line 403)

Retrieve the currently set base URL

  • access: public
string getBaseUrl ()
getControllerDirectory (line 235)

Retrieve controller directory

Retrieves stored controller directory

  • access: public
string|array getControllerDirectory ()
getDefaultAction (line 281)

Retrieve the default action (unformatted string)

  • access: public
string getDefaultAction ()
getDefaultController (line 258)

Retrieve the default controller (unformatted string)

  • access: public
string getDefaultController ()
getDispatcher (line 427)

Return the dispatcher object.

  • access: public
Zend_Controller_DispatcherInteface getDispatcher ()
getParam (line 508)

Retrieve a single parameter from the controller parameter stack

  • access: public
mixed getParam (string $name)
  • string $name
getParams (line 522)

Retrieve action controller instantiation parameters

  • access: public
array getParams ()
getRequest (line 317)

Return the request object.

  • access: public
getResponse (line 471)

Return the response object.

  • access: public
null|Zend_Controller_Response_Abstract getResponse ()
getRouter (line 357)

Return the router object.

Instantiates a Zend_Controller_Router object if no router currently set.

  • access: public
registerPlugin (line 560)

Register a plugin.

  • access: public
resetInstance (line 154)

Resets all object properties of the singleton instance

Primarily used for testing; could be used to chain front controllers.

  • access: public
void resetInstance ()
returnResponse (line 607)

Set whether dispatch() should return the response without first rendering output. By default, output is rendered and dispatch() returns nothing.

  • return: Returns current setting
  • access: public
boolean returnResponse ([boolean $flag = null])
  • boolean $flag
setBaseUrl (line 387)

Set the base URL used for requests

Use to set the base URL segment of the REQUEST_URI to use when determining PATH_INFO, etc. Examples:

  • /admin
  • /myapp
  • /subdir/index.php
Note that the URL should not include the full URI. Do not use:
  • http://example.com/admin
  • http://example.com/myapp
  • http://example.com/subdir/index.php
If a null value is passed, this can be used as well for autodiscovery (default).

  • access: public
  • throws: Zend_Controller_Exception for non-string $base
Zend_Controller_Front setBaseUrl ([string $base = null])
  • string $base
setControllerDirectory (line 222)

Set controller directory

Stores controller directory to pass to dispatcher. May be an array of directories or a string containing a single directory.

  • access: public
Zend_Controller_Front setControllerDirectory (string|array $directory)
  • string|array $directory: Path to Zend_Controller_Action controller classes or array of such paths
setDefaultAction (line 269)

Set the default action (unformatted string)

  • access: public
Zend_Controller_Front setDefaultAction (string $action)
  • string $action
setDefaultController (line 246)

Set the default controller (unformatted string)

  • access: public
Zend_Controller_Front setDefaultController (string $controller)
  • string $controller
setDispatcher (line 416)

Set the dispatcher object. The dispatcher is responsible for taking a Zend_Controller_Dispatcher_Token object, instantiating the controller, and call the action method of the controller.

  • access: public
setParam (line 483)

Add or modify a parameter to use when instantiating an action controller

  • access: public
Zend_Controller_Front setParam (string $name, mixed $value)
  • string $name
  • mixed $value
setParams (line 496)

Set parameters to pass to action controller constructors

  • access: public
Zend_Controller_Front setParams ( $params)
  • array $params
setRequest (line 297)

Set request class/object

Set the request object. The request holds the request environment.

If a class name is provided, it will instantiate it

  • access: public
  • throws: Zend_Controller_Exception if invalid request class
setResponse (line 451)

Set response class/object

Set the response object. The response is a container for action responses and headers. Usage is optional.

If a class name is provided, instantiates a response object.

  • access: public
  • throws: Zend_Controller_Exception if invalid response class
setRouter (line 335)

Set router class/object

Set the router object. The router is responsible for mapping the request to a controller and action.

If a class name is provided, instantiates router with any parameters registered via setParam() or setParams().

  • access: public
  • throws: Zend_Controller_Exception if invalid router class
throwExceptions (line 588)

Set whether exceptions encounted in the dispatch loop should be thrown or caught and trapped in the response object

Default behaviour is to trap them in the response object; call this method to have them thrown.

  • return: Returns current setting
  • access: public
boolean throwExceptions ([boolean $flag = null])
  • boolean $flag: Defaults to true
unregisterPlugin (line 572)

Unregister a plugin.

  • access: public

Documentation generated on Thu, 18 Jan 2007 09:54:27 -0800 by phpDocumentor 1.3.1