form_selects
in package
Class form_selects
Tags
Table of Contents
Methods
- rowselectwithdesc() : string
- This method generates a row containing a select element with a description option.
- selectwithdesc() : string
- Generates a select input field with a description.
- selectwithdescmultiple() : string
- Generates a select with description and multiple selection
- selectwithoutdescmultiple() : string
- This method generates a select element without the description option and with multiple selection.
- getform() : string
- Generiert die Bootstrap-Form Control für Input Label und falls nötig Beschreibung
- getformdesc() : string
- Generiert die Beschreibung eines Inputs
- getlabel() : string
- Generiert das Label eines Inputs
- getselectwdesc() : string
- Generates a select input with a description.
- getselectwdescmulti() : string
- Generiert ein selektiertes Select-Element mit mehreren Optionen und einer Beschreibung
Methods
rowselectwithdesc()
This method generates a row containing a select element with a description option.
public
rowselectwithdesc(string $label, string $name, string $id, string $desc, string $value, array<string|int, mixed> $values[, string $class = '' ][, string $livesearch = 'false' ][, string $required = '' ]) : string
Parameters
- $label : string
-
The label text for the row.
- $name : string
-
The name attribute of the select element.
- $id : string
-
The id attribute of the select element.
- $desc : string
-
The description text for the select element.
- $value : string
-
The value of the selected option.
- $values : array<string|int, mixed>
-
An associative array representing the key-value pairs for the select options.
- $class : string = ''
-
(Optional) The class attribute of the select element.
- $livesearch : string = 'false'
-
(Optional) The livesearch attribute of the select element.
- $required : string = ''
-
(Optional) The required attribute of the select element.
Return values
string —The HTML string representing the generated row.
selectwithdesc()
Generates a select input field with a description.
public
selectwithdesc(string $label, string $name, string $id, string $desc, string $value, array<string|int, mixed> $values[, string $class = '' ][, string $livesearch = 'false' ][, string $required = '' ]) : string
Parameters
- $label : string
-
The label for the select field.
- $name : string
-
The name attribute for the select field.
- $id : string
-
The ID attribute for the select field.
- $desc : string
-
The description text.
- $value : string
-
The selected value for the select field.
- $values : array<string|int, mixed>
-
An array of possible select values.
- $class : string = ''
-
(optional) The CSS class for the select field.
- $livesearch : string = 'false'
-
(optional) Whether to enable live search (default is 'false').
- $required : string = ''
-
(optional) The required Attribute (default is '').
Return values
string —The generated HTML for the select field with description.
selectwithdescmultiple()
Generates a select with description and multiple selection
public
selectwithdescmultiple(string $label, string $name, string $id, string $desc, array<string|int, mixed> $value, array<string|int, mixed> $values[, string $class = '' ]) : string
Parameters
- $label : string
-
The label text
- $name : string
-
The name attribute of the select element
- $id : string
-
The ID attribute of the select element
- $desc : string
-
The description text
- $value : array<string|int, mixed>
-
The selected value(s)
- $values : array<string|int, mixed>
-
An array of values for the select options
- $class : string = ''
-
(optional) The CSS class for the select element
Return values
string —Generated HTML code for the select with description element
selectwithoutdescmultiple()
This method generates a select element without the description option and with multiple selection.
public
selectwithoutdescmultiple(string $name, string $id, array<string|int, mixed> $value, array<string|int, mixed> $values[, string $class = '' ]) : string
Parameters
- $name : string
-
The name attribute of the select element.
- $id : string
-
The id attribute of the select element.
- $value : array<string|int, mixed>
-
An associative array representing the key-value pairs for the select options.
- $values : array<string|int, mixed>
-
An array containing the values of the selected options.
- $class : string = ''
-
(Optional) The class attribute of the select element.
Return values
string —The HTML string representing the generated select element.
getform()
Generiert die Bootstrap-Form Control für Input Label und falls nötig Beschreibung
private
getform([string $type = '' ]) : string
Parameters
- $type : string = ''
-
Typ der zu generierenden Form-Control
Return values
string —- generierte Form-Control
getformdesc()
Generiert die Beschreibung eines Inputs
private
getformdesc(string $id, string $desc) : string
Parameters
- $id : string
-
ID-Feld der Beschreibung
- $desc : string
-
Beschreibungstext
Return values
string —- generierte Beschreibung
getlabel()
Generiert das Label eines Inputs
private
getlabel(string $id, string $label[, string $class = '' ]) : string
Parameters
- $id : string
-
ID des Inputs
- $label : string
-
Labeltext
- $class : string = ''
-
(optional) CSS-Klasse
Return values
string —- generierte Label
getselectwdesc()
Generates a select input with a description.
private
getselectwdesc(string $name, string $id, string $value, array<string|int, mixed> $values, string $class, string $livesearch, string $required) : string
Parameters
- $name : string
-
- Name of the select input.
- $id : string
-
- ID of the select input.
- $value : string
-
- Value of the selected option.
- $values : array<string|int, mixed>
-
- Array of options with their IDs and names.
- $class : string
-
- CSS class for the select input.
- $livesearch : string
-
- Value for the data-live-search attribute.
- $required : string
-
- Value for the required attribute
Return values
string —- The generated HTML code for the select input.
getselectwdescmulti()
Generiert ein selektiertes Select-Element mit mehreren Optionen und einer Beschreibung
private
getselectwdescmulti(string $name, string $id, array<string|int, mixed> $value, array<string|int, mixed> $values, string $class) : string
Parameters
- $name : string
-
Der Name des Select-Elements
- $id : string
-
Die ID des Select-Elements
- $value : array<string|int, mixed>
-
Das aktuell ausgewählte(n) Wert(e)
- $values : array<string|int, mixed>
-
Die verfügbaren Werte und Optionen
- $class : string
-
(optional) Die CSS-Klasse des Select-Elements
Return values
string —Das generierte Select-Element als HTML-Code