# Router Interface Reference

Inheritance diagram for Router:
[legend]

List of all members.

## Public Member Functions

| route (HttpRequest $request)
| Processes a request and sets its controller and action.
| assembly (array $userParams=array(), $name=null, $reset=false, $encode=true)
| Generates an URL path that can be used in URL creation, redirection, etc.

## Detailed Description

Definition at line 12 of file Router.class.php.

## Member Function Documentation

Router::assembly | ( | array $ | userParams = `array()`,
|  | $ | name = `null`,
|  | $ | reset = `false`,
|  | $ | encode = `true` |
| ) |  |  |

Generates an URL path that can be used in URL creation, redirection, etc.

May be passed user params to override ones from URI, Request or even defaults. If passed parameter has a value of null, it's URL variable will be reset to default.

If null is passed as a route name assemble will use the current Route or 'default' if current is not yet set.

Reset is used to signal that all parameters must be reset to it's defaults.

Ignoring all URL specified values. User specified params still get precedence.

Encode tells to url encode resulting path parts.

Parameters:

  | array | $userParams Options passed by an user used to override parameters
  | mixed | $name The name of a Route to use
  | bool | $reset Whether to reset to the route defaults ignoring URL params
  | bool | $encode Tells to encode URL parts on output

Exceptions:

  | RouterException |

Returns:
  string Resulting URL path

Router::route | ( | HttpRequest $ | request | ) |

Processes a request and sets its controller and action.

If no route was possible, an exception is thrown.

Parameters:

  | HttpRequest |

Exceptions:

  | RouterException |

Returns:
  HttpRequest | boolean

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

- main/Utils/Routers/Router.class.php