Skip to content

danog\MadelineProto\WebUI\Field: A form field.

Back to index

Author: Daniil Gentili daniil@daniil.it

A form field.

Properties

  • $name: string
  • $label: string
  • $type: danog\MadelineProto\WebUI\FieldType
  • $value: string
  • $placeholder: string
  • $hint: (danog\MadelineProto\WebUI\SafeHtml | string)
  • $required: bool
  • $autocomplete: ?string
  • $options: array
  • $showWhen: ?array
  • $autofocus: bool
  • $maxLength: ?int

Method list:

Methods:

__construct(string $name, string $label, \danog\MadelineProto\WebUI\FieldType $type = \danog\MadelineProto\WebUI\FieldType::TEXT, string $value = '', string $placeholder = '', \danog\MadelineProto\WebUI\SafeHtml|string $hint = '', bool $required = true, ?string $autocomplete = NULL, array<string, string> $options = [], ?array{0: string, 1: string} $showWhen = NULL, bool $autofocus = false, ?int $maxLength = NULL)

Parameters:

  • $name: string Name of the POST parameter
  • $label: string Label
  • $type: \danog\MadelineProto\WebUI\FieldType
  • $value: string
  • $placeholder: string
  • $hint: \danog\MadelineProto\WebUI\SafeHtml|string
  • $required: bool
  • $autocomplete: ?string Value of the autocomplete attribute
  • $options: array<string, string> Value => label, for {@see FieldType::CHOICE}
  • $showWhen: ?array{0: string, 1: string} Only show (and submit) the field when the CHOICE field with the given name has the given value
  • $autofocus: bool
  • $maxLength: ?int

See also:

jsonSerialize(): array

getInputAttributes(string $id): array<string, (scalar|null)>

Get the attributes of the input element.

Parameters:

  • $id: string

See also:

  • scalar

Generated by danog/phpdoc