GX::Route::Static - Static route class
# Load the class use GX::Route::Static; # Create a route object $route = GX::Route::Static->new( action => $application->action( 'Blog', 'search' ), method => 'POST', scheme => 'http', host => 'myblog.com', path => '/blog/search' );
This module provides the GX::Route::Static class which extends the GX::Route class.
new
Returns a new GX::Route::Static object.
$route = GX::Route::Static->new( %attributes );
action ( GX::Action object ) [ required ]
action
The associated action.
host ( string )
host
The hostname to bind the route to. If omitted, the route will match any hostname.
is_reversible ( bool )
is_reversible
A boolean flag indicating whether the route is reversible or not. Defaults to true.
method ( string )
method
The name of the HTTP method to bind the route to. If omitted, the route will match any method.
path ( string ) [ required ]
path
The path to bind the route to. Trailing slashes are significant.
scheme ( string )
scheme
The URI scheme to bind the route to. If omitted, the route will match any scheme.
$route ( GX::Route::Static object )
$route
GX::Exception
Returns the associated action.
$action = $route->action;
$action ( GX::Action object )
$action
construct_path
Returns the path.
$path = $route->construct_path;
$path ( string )
$path
construct_uri
Constructs an URI that would match the route.
$uri = $route->construct_uri( %arguments );
fragment ( string )
fragment
The fragment identifier of the URI.
The hostname to use as the authority component of the URI. Ignored if the host attribute is defined, required otherwise.
port ( integer )
port
The port number to append to the hostname.
query ( string )
query
The query component of the URI.
The scheme part of the URI. Ignored if the scheme attribute is defined. Defaults to "http".
$uri ( string )
$uri
Returns true if the route is reversible, otherwise false.
$result = $route->is_reversible;
$result ( bool )
$result
match
Returns a GX::Route::Match object if the route matches, otherwise undef.
undef
$result = $route->match( $context );
$context ( GX::Context object )
$context
$result ( GX::Route::Match object | undef )
Internal method.
$host = $route->host;
$host ( string )
$host
$method = $route->method;
$method ( string )
$method
$path = $route->path;
$scheme = $route->scheme;
$scheme ( string )
$scheme
GX::Route::Match
GX::Route::Static::Compiled
GX::Router
Jörg A. Uzarek <uzarek@runlevelnull.de>
Copyright (c) 2009-2011 Jörg A. Uzarek.
This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation.
To install GX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GX
CPAN shell
perl -MCPAN -e shell install GX
For more information on module installation, please visit the detailed CPAN module installation guide.