Declaration¶
Source position: fptemplate.pp line 107
type
TFPCustomTemplate = class(TPersistent)
public
function HasContent : Boolean;
function GetContent : string;
procedure Assign;
property StartDelimiter: TParseDelimiter; {rw}
property EndDelimiter: TParseDelimiter; {rw}
property ParamStartDelimiter: TParseDelimiter; {rw}
property ParamEndDelimiter: TParseDelimiter; {rw}
property ParamValueSeparator: TParseDelimiter; {rw}
property FileName: string; {rw}
property Template: string; {rw}
property OnGetParam: TGetParamEvent; {rw}
property OnReplaceTag: TReplaceTagEvent; {rw}
property AllowTagParams: Boolean; {rw}
end;
Inheritance¶
Description¶
TFPCustomTemplate is a base class for template processing. It can load a template from a file or from a string and then uses a TTemplateParser instance to parse the template.
Do not use this class directly, use TFPTemplate instead.
Properties¶
| Member | Visibility | Description |
|---|---|---|
| AllowTagParams | public | Allow tags with parameters. |
| EndDelimiter | public | End delimiter for a template variable. |
| FileName | public | Name of the file with the template. |
| ParamEndDelimiter | public | End delimiter for a template variable parameter. |
| ParamStartDelimiter | public | Start delimiter for a template variable parameter. |
| ParamValueSeparator | public | Separator for a template variable parameter and its value. |
| StartDelimiter | public | Start delimiter for a template variable. |
| Template | public | The template text. |
Methods¶
| Member | Visibility | Description |
|---|---|---|
| Assign | public | Assign one template to another. |
| GetContent | public | Get the parsed template content. |
| HasContent | public | Check if the template has content. |
Events¶
| Member | Visibility | Description |
|---|---|---|
| OnGetParam | public | Event to get a value for a template variable. |
| OnReplaceTag | public | Event to replace a tag. |
See also¶
| Name | Description |
|---|---|
| TFPTemplate | Template component. |