$_action
$_action :
"action" attribute for the html form
Form that will output as a theme-enabled HTML table
Also adds JavaScript to validate required fields
__construct( title, name, action, method = post, addtoken = false, summary) :
constructor
title | title of the form |
|
name | "name" attribute for the |
|
action | "action" attribute for the |
|
method | "method" attribute for the |
|
addtoken | whether to add a security token to the form |
|
summary |
None found |
None found |
getObjectID( object, hashinfo = sha1) :
*#@+ retrieves object serialisation/identification id (sha1 used)
each object has serialisation
object | ||
hashinfo |
None found |
getArrayID( value, key, ret, hashinfo = sha1) :
value | ||
key | ||
ret | ||
hashinfo |
None found |
getSummary( encode = false) :
return the summary of the form
encode | To sanitizer the text? |
None found |
getTitle( encode = false) :
return the title of the form
encode | To sanitizer the text? |
None found |
getName( encode = true) :
get the "name" attribute for the <form> tag
Deprecated, to be refactored
encode | To sanitizer the text? |
None found |
getAction( encode = true) :
get the "action" attribute for the <form> tag
encode | To sanitizer the text? |
None found |
None found |
addElement(string|\APIFormElement formElement, required = false) :
Add an element to the form
string|\APIFormElement | formElement | reference to a {@link APIFormElement} |
required | is this a "required" element? |
None found |
getElements( recurse = false) : \APIFormElement||string|int
get an array of forms elements
recurse | get elements recursively? |
array of {@link APIFormElement}s
None found |
getElementNames() : mixed||string|int
get an array of "name" attributes of form elements
array of form element names
None found |
getElementByName( name) :
get a reference to a {@link APIFormElement} object by its "name"
name | "name" attribute assigned to a {@link APIFormElement} |
reference to a {@link APIFormElement}, false if not found
None found |
setElementValue( name, value) :
Sets the "value" attribute of a form element
name | the "name" attribute of a form element |
|
value | the "value" attribute of a form element |
None found |
setElementValues(mixed||string|int values) :
Sets the "value" attribute of form elements in a batch
mixed||string|int | values | array of name/value pairs to be assigned to form elements |
None found |
getElementValue( name, encode = false) :
Gets the "value" attribute of a form element
name | the "name" attribute of a form element |
|
encode | To sanitizer the text? |
the "value" attribute assigned to a form element, null if not set
None found |
getElementValues( encode = false) : mixed||string|int
gets the "value" attribute of all form elements
encode | To sanitizer the text? |
array of name/value pairs assigned to form elements
None found |
setExtra( extra) :
set the extra attributes for the <form> tag
extra | extra attributes for the |
None found |
setSummary( summary) :
set the summary tag for the <form> tag
summary |
None found |
None found |
setRequired(\APIFormElement formElement) :
make an element "required"
\APIFormElement | formElement | reference to a {@link APIFormElement} |
None found |
getRequired() : mixed||string|int
get an array of "required" form elements
array of {@link APIFormElement}s
None found |
insertBreak( extra, class) :
Insert an empty row in the table to serve as a separator.
This method is abstract. It must be overwritten in the child classes.
extra | HTML to be displayed in the empty row. |
||
class | CSS class name for | tag |
None found |
render() :
create HTML to output the form as a theme-enabled table with validation.
YOU SHOULD AVOID TO USE THE FOLLOWING Nocolspan METHOD, IT WILL BE REMOVED
To use the noColspan simply use the following example:
$colspan = new APIFormDhtmlTextArea( '', 'key', $value, '100%', '100%' ); $colspan->setNocolspan(); $form->addElement( $colspan );
None found |
None found |
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;" .
" }";
}
withtags | Include the < javascript > tags in the returned string |
None found |