-
Notifications
You must be signed in to change notification settings - Fork 35
icms_form_Table
Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually!
Form that will output formatted as a HTML table
No styles and no JavaScript to check for required fields.
- Class name: icms_form_Table
- Namespace:
- Parent class: icms_form_Base
private string $_action
"action" attribute for the html form
- Visibility: private
private string $_method
"method" attribute for the form.
- Visibility: private
private string $_name
"name" attribute of the form - this is not strict HTML
- Visibility: private
private string $_title
title for the form
- Visibility: private
protected \icms_form_Element[] $_elements = array()
Elements of form
- Visibility: protected
private array $_extra = array()
extra information for the
tag- Visibility: private
private array $_required = array()
required elements
- Visibility: private
mixed icms_form_Base::insertBreak(string extra)
insert a break in the form
This method is abstract. It must be overwritten in the child classes.
- Visibility: public
- This method is abstract.
- This method is defined by icms_form_Base
- extra string - <p>extra information for the break</p>
mixed icms_form_Base::render()
returns renderered form
This method is abstract. It must be overwritten in the child classes.
- Visibility: public
- This method is abstract.
- This method is defined by icms_form_Base
mixed icms_form_Base::__construct(string title, string name, string action, string method, bool addtoken)
constructor
- Visibility: public
- This method is defined by icms_form_Base
- title string - <p>title of the form</p>
- name string - <p>"name" attribute for the <form> tag</p>
- action string - <p>"action" attribute for the <form> tag</p>
- method string - <p>"method" attribute for the <form> tag</p>
- addtoken bool - <p>whether to add a security token to the form</p>
string icms_form_Base::getTitle(bool encode)
return the title of the form
- Visibility: public
- This method is defined by icms_form_Base
- encode bool - <p>Would you like to sanitize the text?</p>
string icms_form_Base::getName()
get the "name" attribute for the
tagDeprecated, to be refactored
- Visibility: public
- This method is defined by icms_form_Base
string icms_form_Base::getAction(bool encode)
get the "action" attribute for the
tag- Visibility: public
- This method is defined by icms_form_Base
- encode bool - <p>Would you like to sanitize the text?</p>
string icms_form_Base::getMethod()
get the "method" attribute for the
tag- Visibility: public
- This method is defined by icms_form_Base
mixed icms_form_Base::addElement(mixed formElement, bool required)
Add an element to the form
- Visibility: public
- This method is defined by icms_form_Base
- formElement mixed
- required bool - <p>is this a "required" element?</p>
\icms_form_Element[] icms_form_Base::getElements(mixed recurse)
get an array of forms elements
- Visibility: public
- This method is defined by icms_form_Base
- recurse mixed
array icms_form_Base::getElementNames()
get an array of "name" attributes of form elements
- Visibility: public
- This method is defined by icms_form_Base
\icms_form_Element|bool icms_form_Base::getElementByName(string name)
get a reference form object by its "name"
- Visibility: public
- This method is defined by icms_form_Base
- name string - <p>"name" attribute assigned to a form element</p>
mixed icms_form_Base::setElementValue(string name, string value)
Sets the "value" attribute of a form element
- Visibility: public
- This method is defined by icms_form_Base
- name string - <p>the "name" attribute of a form element</p>
- value string - <p>the "value" attribute of a form element</p>
mixed icms_form_Base::setElementValues(array values)
Sets the "value" attribute of form elements in a batch
- Visibility: public
- This method is defined by icms_form_Base
- values array - <p>array of name/value pairs to be assigned to form elements</p>
string icms_form_Base::getElementValue(string name, bool encode)
Gets the "value" attribute of a form element
- Visibility: public
- This method is defined by icms_form_Base
- name string - <p>the "name" attribute of a form element</p>
- encode bool - <p>To sanitizer the text?</p>
array icms_form_Base::getElementValues(bool encode)
gets the "value" attribute of all form elements
- Visibility: public
- This method is defined by icms_form_Base
- encode bool - <p>To sanitizer the text?</p>
mixed icms_form_Base::setExtra(string extra)
set the extra attributes for the
tag- Visibility: public
- This method is defined by icms_form_Base
- extra string - <p>extra attributes for the <form> tag</p>
string icms_form_Base::getExtra()
get the extra attributes for the
tag- Visibility: public
- This method is defined by icms_form_Base
mixed icms_form_Base::setRequired(mixed formElement)
make an element "required"
- Visibility: public
- This method is defined by icms_form_Base
- formElement mixed
\icms_form_Element[] icms_form_Base::getRequired()
get an array of "required" form elements
- Visibility: public
- This method is defined by icms_form_Base
mixed icms_form_Base::display()
displays rendered form
- Visibility: public
- This method is defined by icms_form_Base
mixed icms_form_Base::renderValidationJS(bool withtags)
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;" .
" }";
}
- Visibility: public
- This method is defined by icms_form_Base
- withtags bool - <p>Include the < javascript > tags in the returned string</p>
mixed icms_form_Base::assign(mixed tpl)
assign to smarty form template instead of displaying directly
- Visibility: public
- This method is defined by icms_form_Base
- tpl mixed