Kitto.Web.Routing.Scripts
Registry for dynamic script and CSS injection. Modules register their required JS/CSS files in their initialization section. The page template engine queries this registry to emit the appropriate tags.
TKXScriptRegistry class
Singleton registry. Modules call RegisterScript/RegisterStylesheet in their initialization sections. The page template queries GetScriptTags to emit all registered resources as HTML tags.
constructor Create;Creates the registry with an empty entry list.
destructor Destroy;Frees the entry list.
class destructor DestroyClass;Frees the singleton instance at unit finalization.
procedure RegisterScript(const APath: string;Registers a JavaScript file (e.g. '/js/chart.umd.min.js').
procedure RegisterStylesheet(const APath: string);Registers a CSS stylesheet (e.g. '/css/event-calendar.min.css').
function GetScriptTags(const AResPath: string): string;Returns HTML tags for all registered scripts, using the given resource base path (e.g. '/myapp/res').
function GetStylesheetTags(const AResPath: string): string;Returns HTML tags for all registered stylesheets, using the given resource base path.
