Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | List of all members
Elgg\Router Class Reference

Public Member Functions

 __construct (\Elgg\PluginHooksService $hooks)
 Constructor. More...
 
 route (\Elgg\Http\Request $request)
 Routes the request to a registered page handler. More...
 
 registerPageHandler ($identifier, $function)
 Register a function that gets called when the first part of a URL is equal to the identifier. More...
 
 unregisterPageHandler ($identifier)
 Unregister a page handler for an identifier. More...
 
 getPageHandlers ()
 Get page handlers as array of identifier => callback. More...
 
 allowRewrite (Request $request)
 Filter a request through the route:rewrite hook. More...
 

Detailed Description

Definition at line 18 of file Router.php.

Constructor & Destructor Documentation

Elgg\Router::__construct ( \Elgg\PluginHooksService  $hooks)

Constructor.

Parameters
\Elgg\PluginHooksService$hooksFor customized routing.

Definition at line 29 of file Router.php.

Member Function Documentation

Elgg\Router::allowRewrite ( Request  $request)

Filter a request through the route:rewrite hook.

Parameters
Request$requestElgg request
Returns
Request private

Definition at line 157 of file Router.php.

Elgg\Router::getPageHandlers ( )

Get page handlers as array of identifier => callback.

Returns
array

Definition at line 145 of file Router.php.

Elgg\Router::registerPageHandler (   $identifier,
  $function 
)

Register a function that gets called when the first part of a URL is equal to the identifier.

Parameters
string$identifierThe page type to handle
string$functionYour function name
Returns
bool Depending on success

Definition at line 120 of file Router.php.

Elgg\Router::route ( \Elgg\Http\Request  $request)

Routes the request to a registered page handler.

This function triggers a plugin hook `'route', $identifier` so that plugins can modify the routing or handle a request.

Parameters
\Elgg\Http\Request$requestThe request to handle.
Returns
boolean Whether the request was routed successfully. private

Definition at line 43 of file Router.php.

Elgg\Router::unregisterPageHandler (   $identifier)

Unregister a page handler for an identifier.

Parameters
string$identifierThe page type identifier
Returns
void

Definition at line 136 of file Router.php.


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