Version 0.1
A very serious, industrial web framework in Tcl
 All Data Structures Namespaces Files Functions Variables Pages
Public Member Functions
tanzer::router::entry Class Reference

Public Member Functions

 constructor newMethod newPattern newHost newScript
 
 host
 
 method
 
 pattern
 
 script
 
 relative path
 
 matches request
 

Constructor & Destructor Documentation

tanzer::router::entry::constructor   newMethod newPattern newHost newScript  

Create a new route object with the specified case-insensitive HTTP method regular expression in $newMethod, request path pattern in $newPattern, Host: header match pattern in $newHost, and request handler in $newScript.

Member Function Documentation

tanzer::router::entry::host

Returns the host matching regular expression for the current route.

tanzer::router::entry::matches   request  

Returns true if the tanzer::router::entry object specified by $route matches the current request. Furthermore, upon a successful match, any positional parameters matching the :param format are stored in the current request. The following match criteria are considered, in order:

  1. If the regular expression supplied for the HTTP method of the route does not match that of $request, then return false.
  2. If the regular expression supplied for the HTTP host of the route does not match the HTTP Host: header of $request, then return false.
  3. If the glob pattern supplied for the HTTP reuqest path of the route does not match the path of $request, then return false.

As an additional side effect, any path components matching at and beyond the point of a route path glob are stored as a string in the request environment variable PATH_INFO, in the same fashion as CGI/1.1.

tanzer::router::entry::method

Returns the method routing regular expression for the current route.

tanzer::router::entry::pattern

Returns the request path routing pattern for the current route.

tanzer::router::entry::relative   path  

Given an tanzer::uri object in $path, return the relative path string matched by the ending glob.

tanzer::router::entry::script

Returns the request handler callback script for the current route.


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