Class Form
This class is used to generate, display and treat forms.
- Hawk\Form uses Hawk\Utils
Methods summary
public
|
|
public static
|
|
public
|
|
public
|
|
public
|
|
public
mixed
|
|
public
|
|
public
|
|
public
mixed
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
boolean
|
|
public
mixed
|
#
register( boolean $exit =
Register the submitted data in the database |
public
mixed
|
#
delete( boolean $exit =
Delete the element from the database |
public
|
|
public
|
|
public
array
|
|
public
mixed
|
#
treat( boolean $exit =
Make a generic treatment that detect the action to execute, check the form if necessary, and execute the action |
Methods used from Hawk\Utils
Constants summary
boolean |
NO_EXIT
|
#
false
|
boolean |
EXIT_JSON
|
#
true
|
string |
VIEWS_DIR
|
#
'form/'
|
string |
STATUS_SUCCESS
|
#
'success'
|
string |
STATUS_ERROR
|
#
'error'
|
string |
STATUS_CHECK_ERROR
|
#
'check-error'
|
integer |
HTTP_CODE_SUCCESS
|
#
200
|
integer |
HTTP_CODE_CHECK_ERROR
|
#
412
|
integer |
HTTP_CODE_ERROR
|
#
424
|
string |
ACTION_REGISTER
|
#
'register'
|
string |
ACTION_DELETE
|
#
'delete'
|
string |
DEFAULT_MODEL
|
#
"GenericModel"
|
Properties summary
public
string
|
$method
The submit method (Default : POST) |
#
'post'
|
public
string
|
$name
The form name |
#
''
|
public
string
|
$id
The form id |
#
''
|
public
string
|
$model
The model class used for display and database treatment |
|
public
Object
|
$object
The object treated by the form |
|
public
string
|
$labelWidth
The width of the input labels (if defined, overrides the default label width defined in the theme) |
#
''
|
public
string
|
$status
The submission status. This variable can be used if you want to know the treatment status before executing other instructions |
#
null
|
public
integer
|
$columns
The number of columns to display the form. Each fieldset will be displayed on a column. For example, if you define 6 fieldsets in your form, and select 3 for this property, the form will be displayed on 2 lines, with 3 fieldsets by line. |
#
1
|
public
string
|
$class
This property can be set if you want to apply a css class to the form |
#
''
|
public
boolean
|
$autocomplete
Defines if the form can autocompleted (Default true) |
#
true
|
public
array
|
$fieldsets
The form fieldsets |
#
array()
|
public
array
|
$inputs
The form inputs |
#
array()
|
public
boolean
|
$upload
Defines if the form do an AJAX uplaod |
#
false
|
public
boolean
|
$nomessage
If set to true, no return message will be displayed when the form is submitted |
#
false
|
public
string
|
$action
Defines the form action. Default value is the current URL |
#
''
|
public
array
|
$returns
The data returned by the form |
#
array()
|
public
array
|
$errors
The form errors |
#
array()
|
public
array
|
$reference
The reference to get the object in the database and update it. This property must be displayed as : array( 'field' => 'value', 'field2' => 'value2' ) |
#
array()
|