-
Notifications
You must be signed in to change notification settings - Fork 23
TRlxRazorEngine Component
This is the “engine” component, which can be used in two different scenarios: You can connect it to one ore more RazorProcessor components, to provide shared settings and behavior, rather than customizing each specific processor.
You can let is create RazorProcessors when needed, and place only this component on your web modules. Well, you can also mix the two models.
FilesFolder: the folder with the HTML files
TemplatesFolder: the folder with the templates, used by the @LayoutPage command
LocaleDictionary: the dictionary with the locale (TLanguageSetting) for each language id (see the section on “Translation and Formatting support”)
HomePage: the name of the HTML file used in case of a request of the site root ('/') Methods:
ProcessRequest: is the generic method that can be used to process a TWebRequest. Depending on the path, is will look for a corresponding HTML file to process with a dynamically created RazorProcessor (or use the Homepage HTML file is there is no path in the URL). The parameters of the method are:
- Request: TWebRequest;
- Found: Boolean;
- LoggedUser: Boolean = False;
- LanguageID: Integer = 1
OnValue: Fall back for OnValue event of the current RazorProcessor
OnWarn: Fall back for OnWarn event of the current RazorProcessor
OnLang: Fall back for OnLang event of the current RazorProcessor
OnObjectForPath: is triggered before starting a dynamically generated RazorProcessor, for adding support objects to it.