Class FormInput
This class describes the general behavior of inputs in forms. This class is associated to Form class
- Hawk\FormInput uses Hawk\Utils
Direct known subclasses
Hawk\ButtonInput
,
Hawk\CheckboxInput
,
Hawk\SelectInput
,
Hawk\TextareaInput
,
Hawk\TextInput
,
Hawk\TimeInput
,
Hawk\ColorInput
,
Hawk\FileInput
,
Hawk\HiddenInput
,
Hawk\HtmlInput
,
Hawk\NumberInput
,
Hawk\ObjectInput
,
Hawk\PasswordInput
,
Hawk\RadioInput
Indirect known subclasses
Hawk\DatetimeInput
,
Hawk\DeleteInput
,
Hawk\EmailInput
,
Hawk\FloatInput
,
Hawk\IntegerInput
,
Hawk\SubmitInput
,
Hawk\WysiwygInput
Methods summary
public
|
|
public
|
|
public static
|
|
public
string
|
|
public
string
|
|
public
boolean
|
|
public
mixed
|
|
public
|
|
public static
|
Methods used from Hawk\Utils
Constants summary
boolean |
INDEPENDANT
This constant is used to force the property $independant for all instances of a input class that extends this class |
#
false
|
Properties summary
public static
array
|
$attr
Attributes properties that can be called at input initialization, and there type |
#
array(
'checked' => 'bool',
'class' => 'text',
'cols' => 'int',
'disabled' => 'bool',
'id' => 'text',
'maxlength' => 'int',
'multiple' => 'bool',
'name' => 'text',
'placeholder' => 'html',
'readonly' => 'bool',
'rows' => 'int',
'size' => 'int',
'style' => 'text',
'title' => 'html',
'type' => 'text',
'value' => 'html',
'autocomplete' => 'text',
)
|
public
array
|
$attributes
HTML input attributes, used to apply non listed attributes, as aria or data attributes |
#
array()
|
public
string
|
$class
HTML class attribute |
#
''
|
public
string
|
$title
HTML title attribute |
#
''
|
public
string
|
$style
HTML style attribute |
#
''
|
public
string
|
$name
HTMl name attribute (required) |
|
public
string
|
$id
HTML id attribute. If not given, it will be generated form a uniqid and the name of the input |
|
public
string
|
$value
Field value |
#
''
|
public
string
|
$placeholder
HTML placeholder attribute |
#
''
|
public
integer
|
$maxlength
HTML maxlength attribute |
#
0
|
public
boolean
|
$disabled
HTML disabled attribute |
#
false
|
public
boolean
|
$readonly
HTML readonly attribute |
#
false
|
public
boolean
|
$required
Defines if the field is required or not |
#
false
|
public
string
|
$errorAt
Define this property to display the errors on another input, giving the input name Can be used for example for hidden fields that value is dynamically filled client-side |
#
''
|
public
boolean
|
$nl
Defines if the field has to be displayed on a new line |
#
true
|
public
boolean
|
$notDisplayed
If set to true, the input won't be displayed. Can be usefull to hide a field in a specific usecase |
#
false
|
public
string
|
$before
String to display before the input |
#
''
|
public
string
|
$after
String to display after the input |
#
''
|
public
string
|
$label
The label to display with the input |
#
''
|
public
boolean
|
$beforeLabel
If set to true, the input will be displayed before the label (defaultly, it is displayed after) |
#
false
|
public
string
|
$labelStyle
The style attribute to apply to the label |
#
''
|
public
string
|
$pattern
The regular expression the input value must valid |
#
''
|
public
array
|
$validators
The input validators. Other parameters defaultly fills this property, but can be completed at the instanciation |
#
array()
|
public
string
|
$mask
Mask to apply on the HTML input |
#
''
|
public
boolean
|
$unique
Defines if the value of this field has to be unique in the database |
#
false
|
public
string
|
$dataType
The type of data in the database |
#
''
|
public
string
|
$field
The database field attached to the input |
|
public
mixed
|
$emptyValue
Define the value defined as "empty", default "" |
#
''
|
public
string
|
$labelClass
Define the class on the label |
#
''
|
public
boolean
|
$independant
If set to true, then this field won't be searched and updating in the database |
#
false
|
public
boolean
|
$insert
Define if the input data has to be inserted in database when the form is submitted |
#
true
|
public
string
|
$tpl
The input view filename |
#
''
|