Add

<< Click to Display Table of Contents >>

Navigation:  Classes > THandlers > Methods >

Add

Adds an instance of TContentBase (or descendant class) to the content handlers list.

 

SIGNATURE=IW.Content.Handlers.THandlers.Add@UnicodeString@UnicodeString@TContentBase

 

ETYPE=Method

 

Declaration:

Delphi:

public class function Add(const aPath: UnicodeString; const aDocument: UnicodeString; aHandler: TContentBase): TContentBase; overload;

C++:

public: __fastcall TContentBase Add(const UnicodeString aPath, const UnicodeString aDocument, TContentBase aHandler);

 

Description: UnicodeString used because of FPC

 

Parameters:

 

aPath (string): Path of the document, e.g: '/reports/'

aDocument (string): Name of the document, e.g: 'Report1.html'

aHandler (TContentBase): The instance that will handle the request

Result: Returns the instance (the same reference received in aHandler parameter).

 

Example:

 

THandlers.Add('/reports/', Report1.html, TContentForm.Create(TIWForm1));

 

means: all requests whose URL ends with '/reports/Report1.html' will be redirected to a TContentForm instance, which uses the TIWForm1 class.