NAME

PlackX::Framework::Router::Engine

DESCRIPTION

This module provides route and global filter matching for PlackX::Framework. Please see PlackX::Framework and PlackX::Framework::Router for details of how to use routing and filters in your application.

Difference between Router and Router::Engine

The difference between PXF's ::Router module and the ::Router::Engine is that the Router module is primarily responsible for exporting the routing DSL and processing calls to add routes and filters, while the Router::Engine class is responsible for storing routes and matching routes against requests.

CLASS METHODS

new, instance

Return an object, creating a new one if one does not exist already. This essentially allows each subclass to work as a singleton, so that there is one PXF Router::Engine object per PXF application.

OBJECT METHODS

add_route

Adds a route. Please see documentation for PlackX::Framework::Router. Do not add routes directly to the engine unless you wish to hack on the framework.

add_global_filter

Adds a global filter. Please see documentation for PlackX::Framework::Router. Do not add filters directly to the engine unless you wish to hack on the framework.

match

Match a request against the route data. Returns the matched route and any prefilters and postfilters that should be executed, or undef if no route matches. The returned hashref contains the action to execute, filters applicable to the route, and any parameters in the route, if applicable.

{
  action           => CODEREF,
  prefilters       => ARRAYREF|undef,
  postfilters      => ARRAYREF|undef,
  route_parameters => HASHREF
}

Again, PlackX::Framework handles this for you, so there should be no need to use this method directly.

META

For author, copyright, and license, see PlackX::Framework.