|
| __construct ($title, $name, $action, $method='post', $addtoken=false, $summary='') |
|
| XoopsForm () |
|
| getObjectID ($object, $hashinfo='sha1') |
|
| getArrayID ($value, $key, $ret, $hashinfo='sha1') |
|
| getSummary ($encode=false) |
|
| getTitle ($encode=false) |
|
| getName ($encode=true) |
|
| getAction ($encode=true) |
|
| getMethod () |
|
| addElement ($formElement, $required=false) |
|
& | getElements ($recurse=false) |
|
| getElementNames () |
|
& | getElementByName ($name) |
|
| setElementValue ($name, $value) |
|
| setElementValues ($values) |
|
| getElementValue ($name, $encode=false) |
|
| getElementValues ($encode=false) |
|
| setClass ($class) |
|
| setExtra ($extra) |
|
| setSummary ($summary) |
|
& | getClass () |
|
& | getExtra () |
|
| setRequired (XoopsFormElement $formElement) |
|
& | getRequired () |
|
| insertBreak ($extra=null) |
|
| render () |
|
| display () |
|
| renderValidationJS ($withtags=true) |
|
| assign (XoopsTpl $tpl) |
|
◆ __construct()
__construct |
( |
|
$title, |
|
|
|
$name, |
|
|
|
$action, |
|
|
|
$method = 'post' , |
|
|
|
$addtoken = false , |
|
|
|
$summary = '' |
|
) |
| |
*#- constructor
- Paramètres
-
string | $title | title of the form |
string | $name | "name" attribute for the <form> tag |
string | $action | "action" attribute for the <form> tag |
string | $method | "method" attribute for the <form> tag |
bool | $addtoken | whether to add a security token to the form |
string | $summary | |
Réimplémentée dans XoopsGroupPermForm.
◆ addElement()
addElement |
( |
|
$formElement, |
|
|
|
$required = false |
|
) |
| |
Add an element to the form
- Paramètres
-
◆ assign()
assign to smarty form template instead of displaying directly
- Paramètres
-
- Voir également
- Smarty
◆ display()
◆ getAction()
getAction |
( |
|
$encode = true | ) |
|
get the "action" attribute for the <form> tag
- Paramètres
-
bool | $encode | To sanitizer the text? |
- Renvoie
- string
◆ getArrayID()
getArrayID |
( |
|
$value, |
|
|
|
$key, |
|
|
|
$ret, |
|
|
|
$hashinfo = 'sha1' |
|
) |
| |
- Paramètres
-
| $value | |
| $key | |
| $ret | |
string | $hashinfo | |
- Renvoie
- string
◆ getClass()
get the "class" attribute for the <form> tag
- Renvoie
- string "class" attribute value
◆ getElementByName()
& getElementByName |
( |
|
$name | ) |
|
◆ getElementNames()
get an array of "name" attributes of form elements
- Renvoie
- array array of form element names
◆ getElements()
& getElements |
( |
|
$recurse = false | ) |
|
◆ getElementValue()
getElementValue |
( |
|
$name, |
|
|
|
$encode = false |
|
) |
| |
Gets the "value" attribute of a form element
- Paramètres
-
string | $name | the "name" attribute of a form element |
bool | $encode | To sanitizer the text? |
- Renvoie
- string the "value" attribute assigned to a form element, null if not set
◆ getElementValues()
getElementValues |
( |
|
$encode = false | ) |
|
gets the "value" attribute of all form elements
- Paramètres
-
bool | $encode | To sanitizer the text? |
- Renvoie
- array array of name/value pairs assigned to form elements
◆ getExtra()
get the extra attributes for the <form> tag
- Renvoie
- string
◆ getMethod()
get the "method" attribute for the <form> tag
- Renvoie
- string
◆ getName()
getName |
( |
|
$encode = true | ) |
|
get the "name" attribute for the <form> tag
Deprecated, to be refactored
- Paramètres
-
bool | $encode | To sanitizer the text? |
- Renvoie
- string
◆ getObjectID()
getObjectID |
( |
|
$object, |
|
|
|
$hashinfo = 'sha1' |
|
) |
| |
*#+ retrieves object serialisation/identification id (sha1 used)
each object has serialisation
◆ getRequired()
get an array of "required" form elements
- Renvoie
- array array of XoopsFormElements
◆ getSummary()
getSummary |
( |
|
$encode = false | ) |
|
return the summary of the form
- Paramètres
-
bool | $encode | To sanitizer the text? |
- Renvoie
- string
◆ getTitle()
getTitle |
( |
|
$encode = false | ) |
|
return the title of the form
- Paramètres
-
bool | $encode | To sanitizer the text? |
- Renvoie
- string
◆ insertBreak()
insertBreak |
( |
|
$extra = null | ) |
|
insert a break in the form
This method is abstract. It must be overwritten in the child classes.
- Paramètres
-
string | $extra | extra information for the break @abstract |
◆ render()
◆ renderValidationJS()
renderValidationJS |
( |
|
$withtags = true | ) |
|
Renders the Javascript function needed for client-side for validation
Form elements that have been declared "required" and not set will prevent the form from being submitted. Additionally, each element class may provide its own "renderValidationJS" method that is supposed to return custom validation code for the element.
The element validation code can assume that the JS "myform" variable points to the form, and must execute return false if validation fails.
A basic element validation method may contain something like this: function renderValidationJS() { $name = $this->getName(); return "if (myform.{$name}.value != 'valid') { " . "myform.{$name}.focus(); window.alert( '$name is invalid' ); return false;" . " }"; }
- Paramètres
-
boolean | $withtags | Include the < javascript > tags in the returned string |
- Renvoie
- string
◆ setClass()
set the "class" attribute for the <form> tag
- Paramètres
-
◆ setElementValue()
setElementValue |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
Sets the "value" attribute of a form element
- Paramètres
-
string | $name | the "name" attribute of a form element |
string | $value | the "value" attribute of a form element |
◆ setElementValues()
setElementValues |
( |
|
$values | ) |
|
Sets the "value" attribute of form elements in a batch
- Paramètres
-
array | $values | array of name/value pairs to be assigned to form elements |
◆ setExtra()
set the extra attributes for the <form> tag
- Paramètres
-
string | $extra | extra attributes for the <form> tag |
◆ setRequired()
make an element "required"
- Paramètres
-
◆ setSummary()
set the summary tag for the <form> tag
- Paramètres
-
◆ XoopsForm()
PHP 4 style constructor compatibility shim
- Obsolète:
- all callers should be using parent::__construct()
◆ $_action
◆ $_class
◆ $_elements
◆ $_extra
◆ $_method
◆ $_name
◆ $_objid
$_objid = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' |
additional serialised object checksum (ERM Analysis - Requirement)
- Obsolète:
- @access private
◆ $_required
◆ $_summary
◆ $_title
La documentation de cette classe a été générée à partir du fichier suivant :
- XoopsCore25-2.5.11-Beta1/htdocs/class/xoopsform/form.php