|
| setSubmitText ($text) |
|
| setSubmitPlus ($text) |
|
| __toString () |
|
| to ($type) |
|
| finalize () |
|
| toHtml () |
|
| toXul () |
|
| isValid () |
|
| isI18n () |
|
| getErrors () |
|
| hasErrors () |
|
| addCustomError ($field, $error) |
|
| add ($type, array $prm=array(), $isI18n=false) |
|
| has ($name) |
|
| get ($name) |
|
| del ($name) |
|
| reOrder (array $order) |
|
| reOrderSection (array $order) |
|
| getValue ($name) |
|
| getValues ($onlyFilled=false, $ignoreWhitePassword=true) |
|
| addNotValue ($name) |
|
| getNames () |
|
| setValue ($name, $value, $refill=false) |
|
| setValues (array $data, $refill=false) |
|
| isBound () |
|
| setBound ($bound) |
|
| refill () |
|
| getNew ($type, array $prm) |
|
| addSection ($name) |
|
| setSection ($search) |
|
| setSectionName ($name, $search=null) |
|
| moveToSection ($name, $section=null) |
|
| setMode ($mode, $force=true) |
|
| firstSection () |
|
| lastSection () |
|
| getSection () |
|
| addCaptcha () |
|
| set ($key1, $key2, $val) |
|
| __set ($key, $val) |
|
| __clone () |
|
| getAttr ($name) |
|
| setAttr ($name, $value) |
|
| getCfg () |
|
Final class for form
Definition at line 10 of file form.class.php.
◆ __clone()
Used when cloning the form to create new field element
Definition at line 768 of file form.class.php.
◆ __set()
◆ __toString()
Transform the element to a string to be shown, with the courant output
- Returns
- string
Definition at line 112 of file form.class.php.
◆ add()
add |
( |
|
$type, |
|
|
array |
$prm = array() , |
|
|
|
$isI18n = false |
|
) |
| |
Add a form element in the current section
- Parameters
-
string | form_abstract | $type | Form element type or element form |
array | $prm | Parameter array for the element |
bool | $isI18n | |
- Returns
- form_abstract|null Reference to the added element or null if not added or i18n (name exist yet)
Definition at line 343 of file form.class.php.
◆ addCaptcha()
Add a captcha if parametred and not already added
Definition at line 740 of file form.class.php.
◆ addCustomError()
addCustomError |
( |
|
$field, |
|
|
|
$error |
|
) |
| |
Add a custom error
- Parameters
-
string | $field | Filed name to be associate with |
string | $error | The error text |
Definition at line 325 of file form.class.php.
◆ addNotValue()
Add field to be considered as a non value (ie non attribued in getValues)
- Parameters
-
Definition at line 525 of file form.class.php.
◆ addSection()
Add a new section
- Parameters
-
- Returns
- int The section index
Definition at line 623 of file form.class.php.
◆ afterInit()
Add the first section from the configuration file
Definition at line 85 of file form.class.php.
◆ beforeInit()
Call just before the configuration initialisation
Definition at line 35 of file object.class.php.
◆ del()
◆ finalize()
Finalize the construction of the form. Should be call when i18n are present
Definition at line 220 of file form.class.php.
◆ firstSection()
◆ get()
Get a form element
- Parameters
-
- Returns
- form_abstract|null
Definition at line 384 of file form.class.php.
◆ getAttr()
Get an attribute
- Parameters
-
string | $name | Attribute name |
- Returns
- mixed|null The attribute or null if not set
Definition at line 48 of file object.class.php.
◆ getCfg()
Get the configuration object
- Returns
- config
Definition at line 67 of file object.class.php.
◆ getErrors()
Get all the errors for the last validation
- Returns
- array
Definition at line 306 of file form.class.php.
◆ getNames()
Get all the available names
- Returns
- array
Definition at line 534 of file form.class.php.
◆ getNew()
getNew |
( |
|
$type, |
|
|
array |
$prm |
|
) |
| |
Get a form element for the form type
- Parameters
-
string | $type | Form element type |
array | $prm | Parameter array for the element |
- Returns
- form_abstract Reference to the new element
Definition at line 611 of file form.class.php.
◆ getSection()
Get the current section index
- Returns
- int
Definition at line 733 of file form.class.php.
◆ getValue()
Get the actual value for 1 field
- Parameters
-
- Returns
- mixed
Definition at line 469 of file form.class.php.
◆ getValues()
getValues |
( |
|
$onlyFilled = false , |
|
|
|
$ignoreWhitePassword = true |
|
) |
| |
Get all the values field
- Parameters
-
bool | $onlyFilled | |
bool | $ignoreWhitePassword | |
- Returns
- array
Definition at line 483 of file form.class.php.
◆ has()
Check if the form has a element
- Parameters
-
- Returns
- bool
Definition at line 374 of file form.class.php.
◆ hasErrors()
Check if the form has errors (only if a validations was done)
- Returns
- bool
Definition at line 315 of file form.class.php.
◆ isBound()
Indicates if the form has been bound
- Returns
- boolean
Definition at line 576 of file form.class.php.
◆ isI18n()
Indicate if the form has i18n elements
- Returns
- bool
Definition at line 297 of file form.class.php.
◆ isValid()
Check if all the form elements are valid
- Returns
- bool True if valid
Definition at line 278 of file form.class.php.
◆ lastSection()
◆ moveToSection()
moveToSection |
( |
|
$name, |
|
|
|
$section = null |
|
) |
| |
Move a field to another section
- Parameters
-
string | $name | Fieldname |
int | $section | Section Number. If null, current section will be used |
- Returns
- bool True if the field was found and moved
Definition at line 686 of file form.class.php.
◆ refill()
Refill the whole form from the post argument
Definition at line 592 of file form.class.php.
◆ reOrder()
Reorder the fields in the current section
- Parameters
-
array | $order | Array containing the field names in order wanted |
Definition at line 407 of file form.class.php.
◆ reOrderSection()
reOrderSection |
( |
array |
$order | ) |
|
Reorder the sections
- Parameters
-
array | $order | Array containing either the section index or the section name |
Definition at line 428 of file form.class.php.
◆ set()
set |
( |
|
$key1, |
|
|
|
$key2, |
|
|
|
$val |
|
) |
| |
Set configuration var with a depth of 2
- Parameters
-
string | $key1 | The 1st index |
string | $key2 | The 2nd index |
mixed | $val | The value |
Definition at line 757 of file form.class.php.
◆ setAttr()
setAttr |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
|
inherited |
Set an attribute
- Parameters
-
string | $name | Attribute name |
mixed | $value | Attribute value |
Definition at line 58 of file object.class.php.
◆ setBound()
◆ setMode()
setMode |
( |
|
$mode, |
|
|
|
$force = true |
|
) |
| |
Change the mode of the form
- Parameters
-
string | $mode | edit or view |
bool | $force | True to reaffect all the field |
Definition at line 705 of file form.class.php.
◆ setSection()
Set the current section
- Parameters
-
int | string | $search | Section index or section name |
- Returns
- false|int Section index if found or false
Definition at line 636 of file form.class.php.
◆ setSectionName()
setSectionName |
( |
|
$name, |
|
|
|
$search = null |
|
) |
| |
Set a section name
- Parameters
-
string | $name | Section name to set |
null | int | string | $search | null to set to the current section, int or string to search a section |
- Returns
- bool True if section name was correctly set
Definition at line 659 of file form.class.php.
◆ setSubmitPlus()
◆ setSubmitText()
◆ setValue()
setValue |
( |
|
$name, |
|
|
|
$value, |
|
|
|
$refill = false |
|
) |
| |
Set a field value
- Parameters
-
string | $name | Field name |
mixed | $value | |
boolean | $refill | Indicate if the value is a refill one |
- Returns
- bool True if successful
Definition at line 546 of file form.class.php.
◆ setValues()
setValues |
( |
array |
$data, |
|
|
|
$refill = false |
|
) |
| |
Set values to the form elements
- Parameters
-
array | $data | |
boolean | $refill | Indicate if the value is a refill one |
- Returns
- int Element values updated count
Definition at line 562 of file form.class.php.
◆ to()
Transform the element to a string to be shown
- Parameters
-
string | $type | The output type |
- Returns
- string
Definition at line 129 of file form.class.php.
◆ toHtml()
◆ toXul()
◆ $captchaAdded
◆ $cfg
◆ $curSection
◆ $customErrors
◆ $elements
◆ $elementsSection
$elementsSection = array() |
|
protected |
◆ $errors
◆ $hasFiles
◆ $i18nElements
◆ $isBound
◆ $section
The documentation for this class was generated from the following file: