Skip to content

Celerik\Ui\Support ​

Arr ​

final class Celerik\Ui\Support\Arr

Dot-notation helpers for row arrays (user.name reads $row['user']['name']).

Methods ​

get ​

php
static get(array $row, string $path): mixed

set ​

php
static set(array $row, string $path, mixed $value): void

toText ​

php
static toText(mixed $value): string

Converts a cell value to display text.

Dates ​

final class Celerik\Ui\Support\Dates

Strict ISO 8601 date parsing for values coming from requests and databases.

Only 2026-11-05, 2026-11-05T14:30, 2026-11-05 14:30:00 and the same with seconds, fractions and a Z / +01:00 offset are accepted: PHP's relative formats ("next monday") never are.

Methods ​

parse ​

php
static parse(mixed $value, ?DateTimeZone $timeZone = null): DateTimeImmutable

isDateOnly ​

php
static isDateOnly(mixed $value): bool

EditorHtml ​

final class Celerik\Ui\Support\EditorHtml

Server-side cleaning of rich text editor output (Field::editor()).

The browser can send any HTML, whatever the editor allows, so sanitize before storing or displaying it. The default configuration allows exactly what the Celerik toolbars produce. Requires symfony/html-sanitizer (composer require symfony/html-sanitizer).

Methods ​

sanitize ​

php
static sanitize(string $html, ?HtmlSanitizerConfig $config = null): string

config ​

php
static config(): HtmlSanitizerConfig

Paragraphs, headings (h2-h4), bold, italic, underline, strike, lists, quotes, code, and http(s)/mailto links (forced to rel="noopener noreferrer nofollow").

Html ​

final class Celerik\Ui\Support\Html

Minimal, escaping-by-default HTML builder used by every component.

Methods ​

escape ​

php
static escape(string|int|float|null $value): string

attributes ​

php
static attributes(array $attributes): string

Renders an attribute list. true renders a boolean attribute, null and false skip it.

tag ​

php
static tag(string $name, array $attributes = [], ?string $content = null): string

Renders an element. $content is inserted as-is: escape it before passing user data.

raw ​

php
static raw(string $html): RawHtml

Marks markup as trusted, so content-accepting components insert it unescaped.

content ​

php
static content(Stringable|string $content): string

Content for Modal and Tabs: a string is escaped text, a Stringable (a component, Html::raw(), Laravel's HtmlString, Twig's Markup) is inserted as HTML.

classes ​

php
static classes(array $classes): ?string

Joins CSS classes, dropping empty entries and duplicates.

RawHtml ​

final class Celerik\Ui\Support\RawHtml implements Stringable

Trusted HTML, inserted as-is where components accept content (Modal, Tabs). Create it with Html::raw() only for markup you control or have sanitized.

Methods ​

__construct ​

php
__construct(string $html)

Released under the MIT License.