get('InputfieldText'); * $inputfield->label = 'Your Name'; * $inputfield->attr('name', 'your_name'); * $inputfield->attr('value', 'Roderigo'); * // Add to a $form (InputfieldForm or InputfieldWrapper) * $form->add($inputfield); * ~~~~~ * #pw-body * * ATTRIBUTES * ========== * @property string $name HTML 'name' attribute for Inputfield (required). #pw-group-attribute-properties * @property string $id HTML 'id' attribute for the Inputfield (if not yet, determined automatically). #pw-group-attribute-properties * @property mixed $value HTML 'value' attribute for the Inputfield. #pw-group-attribute-properties * @property string $class HTML 'class' attribute for the Inputfield. #pw-group-attribute-properties * * @method string|Inputfield name($name = null) Get or set the name attribute. @since 3.0.110 #pw-group-attribute-methods * @method string|Inputfield id($id = null) Get or set the id attribute. @since 3.0.110 #pw-group-attribute-methods * @method string|Inputfield class($class = null) Get class attribute or add a class to the class attribute. @since 3.0.110 #pw-group-attribute-methods * * LABELS & CONTENT * ================ * @property string $label Primary label text that appears above the input. #pw-group-labels * @property string $description Optional description that appears under label to provide more detailed information. #pw-group-labels * @property string $notes Optional notes that appear under input area to provide additional notes. #pw-group-labels * @property string $detail Optional text details that appear under notes. @since 3.0.140 #pw-group-labels * @property string $icon Optional font-awesome icon name to accompany label (excluding the "fa-") part). #pw-group-labels * @property string $requiredLabel Optional custom label to display when missing required value. @since 3.0.98 #pw-group-labels * @property string $head Optional text that appears below label but above description (only used by some Inputfields). #pw-internal * @property string|null $prependMarkup Optional markup to prepend to the Inputfield content container. #pw-group-other * @property string|null $appendMarkup Optional markup to append to the Inputfield content container. #pw-group-other * * @method string|Inputfield label($label = null) Get or set the 'label' property via method. @since 3.0.110 #pw-group-labels * @method string|Inputfield description($description = null) Get or set the 'description' property via method. @since 3.0.110 #pw-group-labels * @method string|Inputfield notes($notes = null) Get or set the 'notes' property via method. @since 3.0.110 #pw-group-labels * @method string|Inputfield icon($icon = null) Get or set the 'icon' property via method. @since 3.0.110 #pw-group-labels * @method string|Inputfield requiredLabel($requiredLabel = null) Get or set the 'requiredLabel' property via method. @since 3.0.110 #pw-group-labels * @method string|Inputfield head($head = null) Get or set the 'head' property via method. @since 3.0.110 #pw-group-labels * @method string|Inputfield prependMarkup($markup = null) Get or set the 'prependMarkup' property via method. @since 3.0.110 #pw-group-labels * @method string|Inputfield appendMarkup($markup = null) Get or set the 'appendMarkup' property via method. @since 3.0.110 #pw-group-labels * * APPEARANCE * ========== * @property int $collapsed Whether the field is collapsed or visible, using one of the "collapsed" constants. #pw-group-appearance * @property string $showIf Optional conditions under which the Inputfield appears in the form (selector string). #pw-group-appearance * @property int $columnWidth Width of column for this Inputfield 10-100 percent. 0 is assumed to be 100 (default). #pw-group-appearance * @property int $skipLabel Skip display of the label? See the "skipLabel" constants for options. #pw-group-appearance * * @method int|Inputfield collapsed($collapsed = null) Get or set collapsed property via method. @since 3.0.110 #pw-group-appearance * @method string|Inputfield showIf($showIf = null) Get or set showIf selector property via method. @since 3.0.110 #pw-group-appearance * @method int|Inputfield columnWidth($columnWidth = null) Get or set columnWidth property via method. @since 3.0.110 #pw-group-appearance * @method int|Inputfield skipLabel($skipLabel = null) Get or set the skipLabel constant property via method. @since 3.0.110 #pw-group-appearance * * UIKIT THEME * =========== * @property bool|string $themeOffset Offset/margin for Inputfield, one of 's', 'm', or 'l'. #pw-group-uikit * @property string $themeBorder Border style for Inputfield, one of 'none', 'card', 'hide' or 'line'. #pw-group-uikit * @property string $themeInputSize Input size height/font within Inputfield, one of 's', 'm', or 'l'. #pw-group-uikit * @property string $themeInputWidth Input width for text-type inputs, one of 'xs', 's', 'm', 'l', or 'f' (for full-width). #pw-group-uikit * @property string $themeColor Color theme for Inputfield, one of 'primary', 'secondary', 'warning', 'danger', 'success', 'highlight', 'none'. #pw-group-uikit * @property bool $themeBlank Makes element display with no minimal container / no border when true. #pw-group-uikit * * SETTINGS & BEHAVIOR * =================== * @property int|bool $required Set to true (or 1) to make input required, or false (or 0) to make not required (default=0). #pw-group-behavior * @property string $requiredIf Optional conditions under which input is required (selector string). #pw-group-behavior * @property int|bool|null $requiredAttr Use HTML5 “required” attribute when used by Inputfield and $required is true? Default=null. #pw-group-behavior * @property InputfieldWrapper|null $parent The parent InputfieldWrapper for this Inputfield or null if not set. #pw-internal * @property null|bool|Fieldtype $hasFieldtype The Fieldtype using this Inputfield, or boolean false when known not to have a Fieldtype, or null when not known. #pw-group-other * @property null|Field $hasField The Field object associated with this Inputfield, or null when not applicable or not known. #pw-group-other * @property null|Page $hasPage The Page object associated with this Inputfield, or null when not applicable or not known. #pw-group-other * @property null|Inputfield $hasInputfield If this Inputfield is owned/managed by another (other than parent/child relationship), it may be set here. 3.0.176+ #pw-group-other * @property bool|null $useLanguages When multi-language support active, can be set to true to make it provide inputs for each language, where supported (default=false). #pw-group-behavior * @property null|bool|int $entityEncodeLabel Set to boolean false to specifically disable entity encoding of field header/label (default=true). #pw-group-output * @property null|bool $entityEncodeText Set to boolean false to specifically disable entity encoding for other text: description, notes, etc. (default=true). #pw-group-output * @property int $renderValueFlags Options that can be applied to renderValue mode, see "renderValue" constants (default=0). #pw-group-output * @property string $wrapClass Optional class name (CSS) to apply to the HTML element wrapping the Inputfield. #pw-group-other * @property string $headerClass Optional class name (CSS) to apply to the InputfieldHeader element #pw-group-other * @property string $contentClass Optional class name (CSS) to apply to the InputfieldContent element #pw-group-other * @property int|null $textFormat Text format to use for description/notes text in Inputfield (see textFormat constants) #pw-group-output * * @method string|Inputfield required($required = null) Get or set required state. @since 3.0.110 #pw-group-behavior * @method string|Inputfield requiredIf($requiredIf = null) Get or set required-if selector. @since 3.0.110 #pw-group-behavior * * @method string|Inputfield wrapClass($class = null) Get wrapper class attribute or add a class to it. @since 3.0.110 #pw-group-other * @method string|Inputfield headerClass($class = null) Get header class attribute or add a class to it. @since 3.0.110 #pw-group-other * @method string|Inputfield contentClass($class = null) Get content class attribute or add a class to it. @since 3.0.110 #pw-group-other * * * HOOKABLE METHODS * ================ * @method string render() * @method string renderValue() * @method void renderReadyHook(Inputfield $parent, $renderValueMode) * @method Inputfield processInput(WireInputData $input) * @method InputfieldWrapper getConfigInputfields() * @method array getConfigArray() * @method array getConfigAllowContext(Field $field) * @method array exportConfigData(array $data) #pw-internal * @method array importConfigData(array $data) #pw-internal * */ abstract class Inputfield extends WireData implements Module { /** * Not collapsed (display as "open", default) * #pw-group-collapsed-constants * */ const collapsedNo = 0; /** * Collapsed unless opened * #pw-group-collapsed-constants * */ const collapsedYes = 1; /** * Collapsed only when blank * #pw-group-collapsed-constants * */ const collapsedBlank = 2; /** * Hidden, not rendered in the form at all * #pw-group-collapsed-constants * */ const collapsedHidden = 4; /** * Collapsed only when populated * #pw-group-collapsed-constants * */ const collapsedPopulated = 5; /** * Not collapsed, value visible but not editable * #pw-group-collapsed-constants * */ const collapsedNoLocked = 6; /** * Collapsed when blank, value visible but not editable * #pw-group-collapsed-constants * */ const collapsedBlankLocked = 7; /** * Collapsed unless opened (value becomes visible but not editable) * #pw-group-collapsed-constants * */ const collapsedYesLocked = 8; /** * Same as collapsedYesLocked, for backwards compatibility * #pw-internal * */ const collapsedLocked = 8; /** * Never collapsed, and not collapsible * #pw-group-collapsed-constants * */ const collapsedNever = 9; /** * Collapsed and dynamically loaded by AJAX when opened * #pw-group-collapsed-constants * */ const collapsedYesAjax = 10; /** * Collapsed only when blank, and dynamically loaded by AJAX when opened * #pw-group-collapsed-constants * */ const collapsedBlankAjax = 11; /** * Don't skip the label (default) * #pw-group-skipLabel-constants * */ const skipLabelNo = false; /** * Don't use a "for" attribute with the