Blesta Source Documentation

FieldsInterface

Fields Interface

Provides the structure for inputs to set which fields to appear when interacting with the input via Blesta in various places.

Table of Contents

Methods

fieldButton() Creates a button with default type=button, can be overriden by attirbutes
fieldCheckbox() Creates a checkbox
fieldFile() Creates a file input field
fieldHidden() Creates a hidden input field
fieldImage() Creates an image input field
fieldMultiSelect() Creates a select list with multiple selectable options
fieldPassword() Creates a password input field
fieldRadio() Creates a radio box
fieldReset() Creates a reset input field
fieldSelect() Creates a select list
fieldSubmit() Creates a button of type submit
fieldText() Creates a text input field
fieldTextarea() Creates a textarea field
label() Creates a label with the given name and marks it for the given field
tooltip() Creates a tooltip with the given message
Methods

fieldButton()

Creates a button with default type=button, can be overriden by attirbutes

public fieldButton(string $name[, string $value = null ][, array<string|int, mixed> $attributes = [] ][, FieldInterface $label = null ]) : FieldInterface
Parameters
$name : string

The name to set in the HTML name field

$value : string = null

The value to set in the HTML value field

$attributes : array<string|int, mixed> = []

Attributes for this input field

$label : FieldInterface = null

A FieldInterface object representing the label to attach to this field (see FieldsInterface::label)

Tags
see
FieldsInterface::label()
see
FieldInterface::attach()
Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

fieldCheckbox()

Creates a checkbox

public fieldCheckbox(string $name[, string $value = null ][, bool $checked = false ][, array<string|int, mixed> $attributes = [] ][, FieldInterface $label = null ]) : FieldInterface
Parameters
$name : string

The name to set in the HTML name field

$value : string = null

The value to set in the HTML value field

$checked : bool = false

True to set this field as checked

$attributes : array<string|int, mixed> = []

Attributes for this input field

$label : FieldInterface = null

A FieldInterface object representing the label to attach to this field (see FieldsInterface::label)

Tags
see
FieldsInterface::label()
see
FieldInterface::attach()
Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

fieldFile()

Creates a file input field

public fieldFile(string $name[, array<string|int, mixed> $attributes = [] ][, FieldInterface $label = null ]) : FieldInterface
Parameters
$name : string

The name to set in the HTML name field

$attributes : array<string|int, mixed> = []

Attributes for this input field

$label : FieldInterface = null

A FieldInterface object representing the label to attach to this field (see FieldsInterface::label)

Tags
see
FieldsInterface::label()
see
FieldInterface::attach()
Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

fieldHidden()

Creates a hidden input field

public fieldHidden(string $name[, string $value = null ][, array<string|int, mixed> $attributes = [] ]) : FieldInterface
Parameters
$name : string

The name to set in the HTML name field

$value : string = null

The value to set in the HTML value field

$attributes : array<string|int, mixed> = []

Attributes for this input field

Tags
see
FieldsInterface::label()
see
FieldInterface::attach()
Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

fieldImage()

Creates an image input field

public fieldImage(string $name[, string $value = null ][, array<string|int, mixed> $attributes = [] ][, FieldInterface $label = null ]) : FieldInterface
Parameters
$name : string

The name to set in the HTML name field

$value : string = null

The value to set in the HTML value field

$attributes : array<string|int, mixed> = []

Attributes for this input field

$label : FieldInterface = null

A FieldInterface object representing the label to attach to this field (see FieldsInterface::label)

Tags
see
FieldsInterface::label()
see
FieldInterface::attach()
Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

fieldMultiSelect()

Creates a select list with multiple selectable options

public fieldMultiSelect(string $name[, array<string|int, mixed> $options = [] ][, string $selected_values = [] ][, array<string|int, mixed> $attributes = [] ][, array<string|int, mixed> $option_attributes = [] ][, FieldInterface $label = null ]) : FieldInterface
Parameters
$name : string

The name to set in the HTML name field

$options : array<string|int, mixed> = []

The options to place in this select list

$selected_values : string = []

The options to set as selected

$attributes : array<string|int, mixed> = []

Attributes for this input field

$option_attributes : array<string|int, mixed> = []

Attributes for each option to set. If single dimension will set the attributes for every option, if multi-dimensional will set option for each element key that matches in $options

$label : FieldInterface = null

A FieldInterface object representing the label to attach to this field (see FieldsInterface::label)

Tags
see
FieldsInterface::label()
see
FieldInterface::attach()
Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

fieldPassword()

Creates a password input field

public fieldPassword(string $name[, array<string|int, mixed> $attributes = [] ][, FieldInterface $label = null ]) : FieldInterface
Parameters
$name : string

The name to set in the HTML name field

$attributes : array<string|int, mixed> = []

Attributes for this input field

$label : FieldInterface = null

A FieldInterface object representing the label to attach to this field (see FieldsInterface::label)

Tags
see
FieldsInterface::label()
see
FieldInterface::attach()
Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

fieldRadio()

Creates a radio box

public fieldRadio(string $name[, string $value = null ][, bool $checked = false ][, array<string|int, mixed> $attributes = [] ][, FieldInterface $label = null ]) : FieldInterface
Parameters
$name : string

The name to set in the HTML name field

$value : string = null

The value to set in the HTML value field

$checked : bool = false

True to set this field as checked

$attributes : array<string|int, mixed> = []

Attributes for this input field

$label : FieldInterface = null

A FieldInterface object representing the label to attach to this field (see FieldsInterface::label)

Tags
see
FieldsInterface::label()
see
FieldInterface::attach()
Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

fieldReset()

Creates a reset input field

public fieldReset(string $name[, string $value = null ][, array<string|int, mixed> $attributes = [] ][, FieldInterface $label = null ]) : FieldInterface
Parameters
$name : string

The name to set in the HTML name field

$value : string = null

The value to set in the HTML value field

$attributes : array<string|int, mixed> = []

Attributes for this input field

$label : FieldInterface = null

A FieldInterface object representing the label to attach to this field (see FieldsInterface::label)

Tags
see
FieldsInterface::label()
see
FieldInterface::attach()
Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

fieldSelect()

Creates a select list

public fieldSelect(string $name[, array<string|int, mixed> $options = [] ][, mixed $selected_value = null ][, array<string|int, mixed> $attributes = [] ][, array<string|int, mixed> $option_attributes = [] ][, FieldInterface $label = null ]) : FieldInterface
Parameters
$name : string

The name to set in the HTML name field

$options : array<string|int, mixed> = []

The options to place in this select list

$selected_value : mixed = null

The option(s) to set as selected

$attributes : array<string|int, mixed> = []

Attributes for this input field

$option_attributes : array<string|int, mixed> = []

Attributes for each option to set. If single dimension will set the attributes for every option, if multi-dimensional will set option for each element key that matches in $options

$label : FieldInterface = null

A FieldInterface object representing the label to attach to this field (see FieldsInterface::label)

Tags
see
FieldsInterface::label()
see
FieldInterface::attach()
Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

fieldSubmit()

Creates a button of type submit

public fieldSubmit(string $name[, string $value = null ][, array<string|int, mixed> $attributes = [] ][, FieldInterface $label = null ]) : FieldInterface
Parameters
$name : string

The name to set in the HTML name field

$value : string = null

The value to set in the HTML value field

$attributes : array<string|int, mixed> = []

Attributes for this input field

$label : FieldInterface = null

A FieldInterface object representing the label to attach to this field (see FieldsInterface::label)

Tags
see
FieldsInterface::label()
see
FieldInterface::attach()
Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

fieldText()

Creates a text input field

public fieldText(string $name[, string $value = null ][, array<string|int, mixed> $attributes = [] ][, FieldInterface $label = null ]) : FieldInterface
Parameters
$name : string

The name to set in the HTML name field

$value : string = null

The value to set in the HTML value field

$attributes : array<string|int, mixed> = []

Attributes for this input field

$label : FieldInterface = null

A FieldInterface object representing the label to attach to this field (see FieldsInterface::label)

Tags
see
FieldsInterface::label()
see
FieldInterface::attach()
Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

fieldTextarea()

Creates a textarea field

public fieldTextarea(string $name[, string $value = null ][, array<string|int, mixed> $attributes = [] ][, FieldInterface $label = null ]) : FieldInterface
Parameters
$name : string

The name to set in the HTML name field

$value : string = null

The value to set in this textarea

$attributes : array<string|int, mixed> = []

Attributes for this input field

$label : FieldInterface = null

A FieldInterface object representing the label to attach to this field (see FieldsInterface::label)

Tags
see
FieldsInterface::label()
see
FieldInterface::attach()
Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

label()

Creates a label with the given name and marks it for the given field

public label(string $name[, string $for = null ][, array<string|int, mixed> $attributes = null ][, bool $preserve_tags = false ]) : FieldInterface
Parameters
$name : string

The name of this label

$for : string = null

The ID of the form element this label is part of

$attributes : array<string|int, mixed> = null

Attributes for this label

$preserve_tags : bool = false

True to preserve tags in the label name

Return values
FieldInterface

A FieldInterface object to be passed into one of the various field methods to assign this label to that field

tooltip()

Creates a tooltip with the given message

public tooltip(string $message) : FieldInterface
Parameters
$message : string

The tooltip message

Return values
FieldInterface

A FieldInterface object that can be attached to a FieldInterface label

Tags
subpackage

core.Util.Input.Fields.Common

copyright

Copyright (c) 2020, Phillips Data, Inc.

license

http://www.blesta.com/license/ The Blesta License Agreement

link

Blesta

see
FieldInterface

        
On this page

Search results