PluginFormForm_v1
Build from wf/form_v2 to keep form data in variable $data. Plugin to render and handle forms.
translate
setData
getData
setDataFromFile
getSchemaFieldPrimary
Primary key (only one).
setFormItemsDefaultFromDb
handle_plugin
widget_render
Widget setup
type: widget
data:
plugin: form/form_v1
method: render
data:
url: '/p/test/?_time=1'
ajax: true
submit_value: Save
id: frm_test
items:
type_of_issue:
type: varchar
lable: 'Type of issue'
default: null
mandatory: true
option:
'': ''
1: Applikation
2: Database
container_classzzz: row
email:
type: varchar
lable: Email
default: null
mandatory: true
validator:
-
plugin: wf/form
method: validate_email
name:
type: varchar
lable: Name
default: John
important_level:
type: varchar
lable: 'Level of important (1-10)'
mandatory: true
validator:
-
plugin: wf/form
method: validate_numeric
data:
min: 1
max: 10
description:
type: text
lable: Description
default: null
mandatory: true
description_as_html:
type: text
lable: 'Description as HTML (require PluginWysiwygNicedit inlcude widget to be included)'
default: null
html: true
send_copy_of_this:
type: checkbox
lable: 'Send copy of this'
capture:
_buto: 'Set capture params for using the Capture widget.'
plugin: wf/form
method: test_capture
render:
plugin: wf/form
method: test_render
validation_before:
plugin: wf/form
method: test_validation_before
_layout_help: 'Use the layout param to customize your form. Don´t miss to use the include widget if using this.'
_layout:
-
type: div
attribute:
class: row
innerHTML:
-
type: div
attribute:
class: col-md-4
innerHTML: 'item[{"id": "type_of_issue", "type": "div"}]'
Render a form.
Consider to add data in separate yml file because you need to pic it up again when handle posting values. Use widget to handle post request if necessary.
'yml:/theme/wf/buto/form/my_form.yml'
getSchema
Get fields via schema.
getRow
@param string $key @param array $value @param array $default @return array
getLabel
widget_capture
Widget setup
type: widget
data:
plugin: form/form_v1
method: capture
Capture post from form via ajax. @param array $data @return string
isValid
hasValidationBefore
hasCapture
hasRender
has
bind
Bind request params to form. @param boolean $preserve_default @return null
setDefaultsFromArray
Bind array where keys matching keys in form.
setPostvalue
Bind array where keys matching keys in form.
setOptionFromArray
Set option from array. - value: 11 option: 'Blekinge län' - value: 19 option: Dalarna
getOption
Format options to be used in forms. @param Array $array Keys must be value and option. @param Boolena $add_empty If begin with an empty option. @return Array
validate
Validate form. @return boolean
bindAndValidate
Bind and validate form. @return boolean
setErrorField
Set error for a field. @param string $field @param string $message @return null
getErrors
Get errors in plain text.
@param string $nl Default '
'
@return string
getErrorsScript
getErrorsAsArray
Get all form errors as array. @param PluginWfArray $form @return Array
validate_email
Validate email. @param string $field @param array $form @param array $data @return array
validate_link
validate_password
Validate password. @param string $field @param array $form @param array $data @return type
validatePasswordAbcdef09
Validate password. @param string $password @param array $settings @return array
validate_equal
Validate equal. @param string $field @param array $form @param array $data @return array
validate_date
Validate date. @param string $field @param array $form @param array $data @return array
isDate
Check if value is a date. @param string $value @return boolean
validate_numeric
Validate numeric. @param string $field @param array $form @param array $data @return array
validate_integer
Validate integer. @param string $field @param array $form @param array $data @return array
is_integer
validate_double
Check double and decimals. Param data/decimals must be set. @param string $field @param array $form @param array $data @return array
check_decimals
is_double
saveToYml
Save form to yml file. @param PluginWfArray $form @return boolean
runCaptureMethod
Capture method. @param string $type @return null
test_validation_before
test_capture
Method to test capture. @return type
schema_capture
widget_include
Widget setup
type: widget
data:
plugin: form/form_v1
method: include
Include javascript file.
send
Dependencies
Usage
Request a plugin
If you need a plugin to your website, one could make a request to a developer.