Skip to content

Kitto.Html.Base

Foundation classes for the KittoX HTML rendering pipeline. Defines the base interfaces and component class that replace TJSObject/TJSBase for server-side HTML generation using TemplatePro + HTMX + AlpineJS.

IKXController interface

Controller interface for KittoX HTML components. Replaces IJSController for the HTML rendering pipeline.

pascal
procedure Display;

Prepares the controller for rendering (create sub-objects, read config).

pascal
property View: TKView read GetView write SetView;

The view this controller renders.

pascal
property Config: TEFComponentConfig read GetConfig;

The controller's configuration node.

pascal
property Container: IKXContainer read GetContainer write SetContainer;

The container hosting this controller, if any.

pascal
function IsSynchronous: Boolean;

True if the controller renders synchronously (no async round-trip).

pascal
function Render: string;

Renders the controller to an HTML string.

IKXContainer interface

Container interface for KittoX components that host child controllers.

pascal
procedure AddController(const AController: IKXController);

Adds a child controller to be rendered by RenderChildren.

pascal
function RenderChildren: string;

Renders all child controllers and returns the concatenated HTML.

TKXComponent class

Base class for all KittoX HTML components. Inherits from TEFComponent for config/logging support. Each component renders to an HTML string via the Render method.

pascal
function QueryInterface(const IID: TGUID;

IInterface: queries a supported interface.

pascal
function _AddRef: Integer;

IInterface: increments the reference count.

pascal
function _Release: Integer;

IInterface: decrements the reference count (frees at zero).

pascal
procedure Display;

Prepares the component for rendering (no-op by default).

pascal
property View: TKView read GetView write SetView;

The view this component renders.

pascal
property Container: IKXContainer read GetContainer write SetContainer;

The container hosting this component, if any.

pascal
function IsSynchronous: Boolean;

True if the component renders synchronously.

pascal
function GetHtmlId: string;

Returns a unique HTML element id for this component. Format: 'kx-{ViewName}' or 'kx-{ControllerType}-{sequence}'.

pascal
function Render: string;

Renders this component to an HTML string. Must be overridden by concrete subclasses.

Released under Apache License, Version 2.0.