Celerik\Ui\Components\Form
Field
final class Celerik\Ui\Components\Form\Field
A Bootstrap form control with validation rules.
Rules are emitted as native HTML5 attributes (required, minlength, pattern...), which Parsley.js reads on the client and browsers understand without JavaScript.
Methods
input
static input(string $type, string $name, ?string $label = null): selftext
static text(string $name, ?string $label = null): selfemail
static email(string $name, ?string $label = null): selfpassword
static password(string $name, ?string $label = null): selfnumber
static number(string $name, ?string $label = null): selftel
static tel(string $name, ?string $label = null): selfdate
static date(string $name, ?string $label = null): selfhidden
static hidden(string $name, string|int|float $value): selftextarea
static textarea(string $name, ?string $label = null): selfselect
static select(string $name, array $choices, ?string $label = null): selfcheckbox
static checkbox(string $name, ?string $label = null): selffile
static file(string $name, ?string $label = null): selfFile upload. Without upload() it is a plain file input (the form switches to multipart); with upload() FilePond sends each file to that endpoint first.
editor
static editor(string $name, ?string $label = null): selfRich text editor (Quill). Submits HTML: always sanitize it on the server (see EditorHtml::sanitize()).
rules
rules(UploadRules $rules): selfAccepted files for a file field (defaults to UploadRules::images()). Use the same rules in the UploadHandler.
upload
upload(string $url): selfUploads each file asynchronously to this endpoint (FilePond server protocol: POST returns the id as text/plain, DELETE with the id as body reverts it). The form then submits the ids; claim them with UploadHandler::claim().
toolbar
toolbar(array|string $toolbar): selfEditor toolbar: "basic", "standard" (default), "full", or a Quill toolbar array.
required
required(bool $required = true): selfminLength
minLength(int $length): selfmaxLength
maxLength(int $length): selfmin
min(string|int|float $min): selfmax
max(string|int|float $max): selfpattern
pattern(string $pattern): selfHTML5 pattern (anchored implicitly, no delimiters), e.g. [A-Z]{2}[0-9]{4}.
equalTo
equalTo(string $fieldName): selfRequires the same value as another field of the form (password confirmation).
mask
mask(string $mask): selfInputmask.js mask, e.g. 99/99/9999 or (999) 999-9999.
message
message(string $message): selfCustom client-side error message for every rule of this field.
placeholder
placeholder(string $placeholder): selfhelp
help(string $help): selfvalue
value(mixed $value): selfattribute
attribute(string $name, string|int|float|bool|null $value = true): selfgetName
getName(): stringgetType
getType(): stringrender
render(string $formId, ?string $error = null, mixed $value = null, bool $floating = false): string$error: Server-side error message to display.$value: Submitted value, takes precedence over the field default.$floating: Bootstrap floating label (text-like inputs, selects and textareas only).
fieldId
static fieldId(string $formId, string $name): stringisFile
isFile(): bool