Hawk - PHP documentation
  • Namespace
  • Class
  • Tree

Namespaces

  • Hawk
    • View
      • Plugins

Classes

  • App
  • ButtonInput
  • Cache
  • CheckboxInput
  • ColorInput
  • Conf
  • Controller
  • Crypto
  • DatabaseSessionHandler
  • DatetimeInput
  • DB
  • DBExample
  • DeleteInput
  • Dialogbox
  • EmailInput
  • ErrorHandler
  • Event
  • FileInput
  • FileSystem
  • FloatInput
  • Form
  • FormFieldset
  • FormInput
  • GenericModel
  • GifImage
  • HawkApi
  • HawkUpdater
  • HiddenInput
  • HtmlInput
  • HTTPRequest
  • Icon
  • Image
  • IntegerInput
  • ItemList
  • ItemListField
  • JpegImage
  • Lang
  • Language
  • LeftSidebarTab
  • Less
  • Logger
  • Mail
  • MenuItem
  • Model
  • NoSidebarTab
  • NumberInput
  • ObjectInput
  • Option
  • Panel
  • PasswordInput
  • Permission
  • Plugin
  • PluginInstaller
  • PngImage
  • ProfileQuestion
  • ProfileQuestionValue
  • RadioInput
  • Request
  • Response
  • RightSidebarTab
  • Role
  • RolePermission
  • Route
  • Router
  • SelectInput
  • Session
  • Singleton
  • SubmitInput
  • Tabs
  • TextareaInput
  • TextInput
  • Theme
  • TimeInput
  • Upload
  • User
  • View
  • ViewPlugin
  • Widget
  • WysiwygInput

Traits

  • Utils

Exceptions

  • AppStopException
  • DBExampleException
  • DBException
  • FileSystemException
  • HawkApiException
  • ImageException
  • MailException
  • UploadException
  • ViewException

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

Namespace: Hawk
Package: Form\Input
Located at Form/FormInput.php

Methods summary

public
# __construct( array $param )

Constructor

Constructor

Parameters

$param
The input parameters. This arguments is an associative array where each key is the name of a property of this class
public
# setParam( string|array $param, mixed $value = null )

Set the input parameters

Set the input parameters

Parameters

$param
If set as a string, the name of the parameter to set. If an array, a set of parameters
$value
The value to set, in case the parameter $param is a string
public static Hawk\FormInput
# create( array $param )

Create a input instance with it parameters

Create a input instance with it parameters

Parameters

$param

The input parameters. This arguments is an associative array where each key is the name of a property of this class

Returns

Hawk\FormInput
The created instance
public string
# __toString( )

Display the input

Display the input

Returns

string
the HTML result of the input displaying
public string
# display( )

Display the input (alias method)

Display the input (alias method)

Returns

string
the HTML result of the input displaying
public boolean
# check( Hawk\Form & $form = null )

Check the submitted value of the input

Check the submitted value of the input

Parameters

$form
The form the input is associated with

Returns

boolean
True if the submitted value is valid, else false
public mixed
# dbvalue( )

Return the value, formatted for the SQL database

Return the value, formatted for the SQL database

Returns

mixed
The value, formatted for the database
public
# setValue( mixed $value )

Set the value to the input

Set the value to the input

Parameters

$value
The value to set
public static Hawk\FormInput
# getInstance( array $parameters )

Create an input from an array, automaticall finding it type

Create an input from an array, automaticall finding it type

Parameters

$parameters
The input parameters, formatted as the constructor parameters, and including a 'type' data

Returns

Hawk\FormInput
The input instance

Methods used from Hawk\Utils

debug(), getSerializedVersion(), map()

Constants summary

boolean INDEPENDANT

This constant is used to force the property $independant for all instances of a input class that extends this class

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

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

HTML input attributes, used to apply non listed attributes, as aria or data attributes

# array()
public string $class

HTML class attribute

HTML class attribute

# ''
public string $title

HTML title attribute

HTML title attribute

# ''
public string $style

HTML style attribute

HTML style attribute

# ''
public string $name

HTMl name attribute (required)

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

HTML id attribute. If not given, it will be generated form a uniqid and the name of the input

#
public string $value

Field value

Field value

# ''
public string $placeholder

HTML placeholder attribute

HTML placeholder attribute

# ''
public integer $maxlength

HTML maxlength attribute

HTML maxlength attribute

# 0
public boolean $disabled

HTML disabled attribute

HTML disabled attribute

# false
public boolean $readonly

HTML readonly attribute

HTML readonly attribute

# false
public boolean $required

Defines if the field is required or not

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

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

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

If set to true, the input won't be displayed. Can be usefull to hide a field in a specific usecase

# false
public boolean $hidden

If set to true, the input will be displayed but with a display none

If set to true, the input will be displayed but with a display none

# false
public string $before

String to display before the input

String to display before the input

# ''
public string $after

String to display after the input

String to display after the input

# ''
public string $label

The label to display with the input

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)

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

The style attribute to apply to the label

# ''
public string $pattern

The regular expression the input value must valid

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

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

Mask to apply on the HTML input

# ''
public boolean $unique

Defines if the value of this field has to be unique in the database

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

The type of data in the database

# ''
public string $field

The database field attached to the input

The database field attached to the input

#
public mixed $emptyValue

Define the value defined as "empty", default ""

Define the value defined as "empty", default ""

# ''
public string $labelClass

Define the class on the label

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

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

Define if the input data has to be inserted in database when the form is submitted

# true
public string $tpl

The input view filename

The input view filename

# ''
Hawk - PHP documentation API documentation generated by ApiGen