Class Zend_Controller_RewriteRouter

Description

Implements interfaces:

Ruby routing based Router.

Located in /Zend/Controller/RewriteRouter.php (line 43)


	
			
Variable Summary
Method Summary
 void __construct ([ $params = array()])
 void addConfig ( $config, string $section)
 void addRoute (string $name, Zend_Controller_Router_Route_Interface $route)
 void addRoutes (array $routes)
 Zend_Controller_RewriteRouter clearParams ([null|string|array $name = null])
 mixed getParam (string $name)
 array getParams ()
 array getRoutes ()
 boolean hasRoute (string $name)
 void removeRoute (string $name)
 Zend_Controller_RewriteRouter setParam (string $name, mixed $value)
Variables
mixed $useDefaultRoutes = true (line 46)
  • access: protected
mixed $_currentRoute = null (line 55)
  • access: protected
array $_invokeParams = array() (line 53)

Array of invocation parameters to use when instantiating action

controllers

  • access: protected
mixed $_routes = array() (line 54)
  • access: protected
Methods
Constructor __construct (line 63)

Constructor

  • access: public
void __construct ([ $params = array()])
  • array $params: Optional invocation arguments
addConfig (line 206)

Create routes out of Zend_Config configuration

Example INI: routes.archive.route = "archive/:year/*" routes.archive.defaults.controller = archive routes.archive.defaults.action = show routes.archive.defaults.year = 2000 routes.archive.reqs.year = "\d+"

routes.news.type = "Zend_Controller_Router_StaticRoute" routes.news.route = "news" routes.news.defaults.controller = "news" routes.news.defaults.action = "list"

And finally after you have created a Zend_Config with above ini: $router = new Zend_Controller_RewriteRouter(); $router->addConfig($config, 'routes');

  • access: public
  • throws: Zend_Controller_Router_Exception
void addConfig ( $config, string $section)
  • Zend_Config $config: Configuration object
  • string $section: Name of the config section containing route's definitions
addDefaultRoutes (line 149)

Add default routes which are used to mimic basic router behaviour

  • access: protected
void addDefaultRoutes ()
addRoute (line 168)

Add route to the route chain

  • access: public
void addRoute (string $name, Zend_Controller_Router_Route_Interface $route)
addRoutes (line 177)

Add routes to the route chain

  • access: public
void addRoutes (array $routes)
  • array $routes: Array of routes with names as keys and routes as values
clearParams (line 129)

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_RewriteRouter clearParams ([null|string|array $name = null])
  • null|string|array $name: single key or array of keys for params to clear

Implementation of:
Zend_Controller_Router_Interface::clearParams()
Clear the controller parameter stack
getCurrentRoute (line 274)

Retrieve a currently matched route

  • return: Route object
  • access: public
  • throws: Zend_Controller_Router_Exception
getCurrentRouteName (line 288)

Retrieve a name of currently matched route

  • return: Route object
  • access: public
  • throws: Zend_Controller_Router_Exception
getParam (line 100)

Retrieve a single parameter from the controller parameter stack

  • access: public
mixed getParam (string $name)
  • string $name

Implementation of:
Zend_Controller_Router_Interface::getParam()
Retrieve a single parameter from the controller parameter stack
getParams (line 114)

Retrieve action controller instantiation parameters

  • access: public
array getParams ()

Implementation of:
Zend_Controller_Router_Interface::getParams()
Retrieve the parameters to pass to helper object constructors
getRoute (line 260)

Retrieve a named route

  • return: Route object
  • access: public
  • throws: Zend_Controller_Router_Exception
Zend_Controller_Router_Route_Interface getRoute (string $name)
  • string $name: Name of the route
getRoutes (line 301)

Retrieve an array of routes added to the route chain

  • return: All of the defined routes
  • access: public
array getRoutes ()
hasRoute (line 248)

Check if named route exists

  • access: public
boolean hasRoute (string $name)
  • string $name: Name of the route
removeDefaultRoutes (line 238)

Remove all standard default routes

  • access: public
void removeDefaultRoutes (string 0, Zend_Controller_Router_Route_Interface 1)
removeRoute (line 225)

Remove a route from the route chain

  • access: public
  • throws: Zend_Controller_Router_Exception
void removeRoute (string $name)
  • string $name: Name of the route
route (line 313)

Find a matching route to the current PATH_INFO and inject returning values to the Request object.

  • return: Request object
  • access: public
  • throws: Zend_Controller_Router_Exception

Implementation of:
Zend_Controller_Router_Interface::route()
Processes a request and sets its controller and action. If no route was possible, an exception is thrown.
setParam (line 75)

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

  • access: public
Zend_Controller_RewriteRouter setParam (string $name, mixed $value)
  • string $name
  • mixed $value

Implementation of:
Zend_Controller_Router_Interface::setParam()
Add or modify a parameter with which to instantiate any helper objects
setParams (line 88)

Set parameters to pass to action controller constructors

  • access: public
Zend_Controller_RewriteRouter setParams ( $params)
  • array $params

Implementation of:
Zend_Controller_Router_Interface::setParams()
Set an array of a parameters to pass to helper object constructors

Documentation generated on Thu, 18 Jan 2007 09:58:41 -0800 by phpDocumentor 1.3.1