◆ __construct()
__construct |
( |
|
$name, |
|
|
|
$title, |
|
|
|
$value, |
|
|
array |
$attributes = [] |
|
) |
| |
|
final |
Constructor of the Input class.
- Parameters
-
$name | |
$title | |
$value | |
$attributes | |
◆ create()
static create |
( |
|
$name, |
|
|
|
$title, |
|
|
|
$value, |
|
|
array |
$attributes = [] |
|
) |
| |
|
static |
A static constructor. Returns a new Input-object.
- Parameters
-
string | $name | |
string | $title | |
mixed | $value | |
array | $attributes | |
- Returns
- static
◆ dataMapper()
◆ extractOptionsFromAttributes()
extractOptionsFromAttributes |
( |
array & |
$attributes | ) |
|
|
protected |
◆ getAllInputNames()
Returns an array with all names of all inputs that this Input-object has. Normally this is just one name because there is only one input. But if you think of i18n-inputs there are possibly more textareas - one for each language. In that case this function would return all names of all inputs that are present.
- Returns
- string[]
◆ getContextObject()
Returns the context-object which is usually a SimpleORMap object.
- Returns
- null|
◆ getFielddataFromMeta()
static getFielddataFromMeta |
( |
|
$meta, |
|
|
|
$object |
|
) |
| |
|
static |
This static method returns fielddata as an array from metadata of a database-field. This array will be used internally to create the best fitting Input object to the database field.
- Parameters
-
- Returns
- array
◆ getName()
Returns the name of the given input. Also have a look at the method getAllInputNames if you want to provide multiple input elements (like in i18n input fields) within one virtual input. In that case this getName method returns the main-input name like the attribute in the SORM class.
- Returns
- null
◆ getParent()
Returns the parent of this Input if there is already one.
- Returns
- null|Part
◆ getRequestValue()
Returns the values from the request. Normally this is ::get, but special Input-classes could also return arrays or objects.
- Returns
- string|null
◆ getTitle()
◆ getValidationCallback()
getValidationCallback |
( |
| ) |
|
◆ getValue()
Returns the value of this input. If $this->value is a callable this->getValue() returns the computed result.
- Returns
- mixed
◆ hasValidation()
◆ render()
This renders the Input.
- Returns
- string
◆ renderWithCondition()
Renders the Input but maybe encapsulated in a template that is displayed only if a condition is true. This is helpful for the if-attribute on the Input like in setIfCondition.
- Returns
- string
◆ setIfCondition()
Sets a condition to display this input. The condition is a javascript condition which is used by vue to hide the input if the condition is not satisfies.
- Parameters
-
- Returns
- $this
◆ setMapper()
setMapper |
( |
Callable |
$callback | ) |
|
Sets a special mapper-function to turn the request-values into the real values for the database.
- Parameters
-
- Returns
- $this
◆ setParent()
setParent |
( |
Part |
$parent | ) |
|
Sets the parent of this Input object. Usually this is done automatically by the framework in the moment that the input is initialized in the Form object. So you usually don't need to call this method on your own.
- Parameters
-
- Returns
- $this
◆ setPermission()
setPermission |
( |
bool |
$permission | ) |
|
Set if the user is able to see and edit this input
- Parameters
-
- Returns
- $this
◆ setRequired()
setRequired |
( |
|
$required = true | ) |
|
Marks the input as a required field.
- Parameters
-
- Returns
- $this
◆ setStoringFunction()
setStoringFunction |
( |
Callable |
$store | ) |
|
Sets the storing function. This would override the normal storing-function that just sets the value of a given context object like a SORM object.
- Parameters
-
- Returns
- $this
◆ setValidationFunction()
setValidationFunction |
( |
Callable |
$validate | ) |
|
Sets the server-side verify function of this input. The callable returns true if the given value is okay, or false or a textstring representing the error.
- Parameters
-
- Returns
- $this
◆ $attributes
◆ $if
◆ $mapper
◆ $name
◆ $parent
◆ $permission
◆ $required
◆ $store
◆ $title
◆ $validate
◆ $value
The documentation for this class was generated from the following file: