Class TBrookRouter
Unit
BrookRouter
Declaration
type TBrookRouter = class(TBrookComponent)
Description
Provides features for the route handling.
Hierarchy
Overview
Methods
Properties
Description
Methods
|
constructor Create(AOwner: TComponent); override; |
Creates an instance of a TBrookRouter class.
|
|
destructor Destroy; override; |
Frees an instance of TBrookRouter class.
|
|
class function GetServiceClass: TBrookRouterClass; |
Return the service class provided by this class.
|
|
class procedure RegisterService; |
Registers the service provided by this class.
|
|
class procedure UnregisterService; |
Unregisters the service provided by this class.
|
|
class function Service: TBrookRouter; |
Return an instance of this class.
|
|
class function RootUrl: string; |
Return the root URL.
|
|
class function RootUrl(ARequest: TBrookRequest): string; |
Return the root URL passing TBrookRequest as param.
|
|
class procedure MethodNotAllowed(AResponse: TBrookResponse); |
Sends the HTTP "NotAllowed" status code to the response.
|
|
function UrlFor(AActionClass: TBrookActionClass; const AParams: array of string): string; overload; |
Creates an URL for an action informing an array of parameters. Exemple:
@(longcode
procedure TMyAction.Get;
begin
Write(UrlFor(TMyAction, ['myvalue']));
end;
initialization
TMyAction.Register('/foo/:myvar');)
|
|
function UrlFor(AClassName: string; const AParams: array of string): string; overload; |
Creates an URL for an action passing an array of parameters however informing the class name as string
|
|
function Canonicalize(ARequest: TBrookRequest; AResponse: TBrookResponse): Boolean; |
Adds an slash to the end of the URL if does not exist.
|
|
function MatchPattern(APattern, APathInfo: string; out ARedirect: Boolean; out ANames, AValues: TBrookArrayOfString): Boolean; virtual; |
Checks if the given parameters match with a registered route.
|
Properties
|
property Routes: TBrookRoutes read FRoutes write FRoutes; |
List of available routes.
|
|
property AfterExecuteAction: TBrookExecuteActionEvent
read FAfterExecuteAction write FAfterExecuteAction; |
Is triggered after the router executes a action.
|
|
property AfterMatchPattern: TBrookMatchPatternEvent
read FAfterMatchPattern write FAfterMatchPattern; |
Is triggered after the router matches a pattern.
|
|
property AfterRoute: TBrookRouteEvent read FAfterRoute
write FAfterRoute; |
Is triggered after the router is routing.
|
|
property BeforeExecuteAction: TBrookExecuteActionEvent
read FBeforeExecuteAction write FBeforeExecuteAction; |
Is triggered before the router executes a action.
|
|
property BeforeMatchPattern: TBrookMatchPatternEvent
read FBeforeMatchPattern write FBeforeMatchPattern; |
Is triggered before the router matches a pattern.
|
|
property BeforeRoute: TBrookRouteEvent read FBeforeRoute
write FBeforeRoute; |
Is triggered before the router is routing.
|
Generated by PasDoc 0.15.0.
|