constructor IsterUIForm
IsterUIForm IsterUIForm(
object IsterHttpRequest
&$data)
|
|
Constructor
Parameters:
method addAction
boolean addAction(
string
$field, string
$method, object
&$object)
|
|
Add an action to perform.
If a button with the name of $field was pressed, the method $method is called. You may specify a method for a field '__default__'. This is invoked if no button was pressed at all. The action will be called on $object. It should implement $method as a method expecting no parameters and returning a boolean value only.
Note: Only the 'name' attribute of the button is checked, not the 'value' attribute.
Parameters:
method addField
boolean addField(
string
$name, [string
$default = null], [boolean
$required = false], [mixed
$constraints = null])
|
|
Add a field to the Form.
If an IsterHttpSecurityPolicy object was set to this form and an array of arrays is passed with the $constraints parameter, a constraint will be added to the policy for each member array of the array. The elements of such a member have the following meaning, according to IsterHttpSecurityPolicy::addConstraint:
- $array[0] - constraint type
- $array[1] - constraint value
- $array[2] - constraint action
- $array[3] - default value
Parameters:
method addFieldGroup
boolean addFieldGroup(
string
$name, array
$fields, [boolean
$required = false])
|
|
Add a form field group (Radio Buttons etc.) to the form.
$fields is an array of key value pairs, each key a field name, each value a default value for the given field.
If an IsterHttpSecurityPolicy object was set to this form, a constraint of type HTTPSP_T_REGEXOK will be added automatically, encountered by the keys of the $fields array.
Parameters:
method addImgButton
boolean addImgButton(
string
$name, string
$method, object
&$object, [array
$rectangle = array()])
|
|
Add an image button to the form.
Unfortunately, the implementation of inputs of type 'image' is very inconsistently between browsers. This method tries its best to make image buttons work.
Some browsers--like IE--omit to include the button's name and value to the POST data, instead the point of click is sent. You may benefit from this behavior in adding an array like this to the parameter list, defining a rectangle:
- Array( 'x1' => <number>
- 'y1' => <number>
- 'x2' => <number>
- 'y2' => <number>
- )
If no such array is added, only the name attribute of the image button is used.
Parameters:
method chgField
boolean chgField(
string
$name, string
$value)
|
|
Change the value of a given form field.
Parameters:
method clear
Reset all form data to the default values.
method execute
boolean execute(
[boolean
$autoset = true])
|
|
Execute the form.
This method calles the first valid action registered by addFormAction().
Parameters:
method getField
mixed getField(
string
$name)
|
|
Get the value of a form field.
Parameters:
method getFieldBool
boolean getFieldBool(
string
$name)
|
|
Test whether a form field is set at all.
Parameters:
method getFieldGroupChecked
boolean getFieldGroupChecked(
string
$name)
|
|
Check whether a given value of a form field group has been checked.
Parameters:
method getFields
Return array of field value pairs, default values if form was not read already.
Useful to fill a template with form values. If the form was read already, all defined security constraints are applied.
method getMarked
mixed getMarked(
string
0)
|
|
If an IsterHttpSecurityPolicy was set to this form and the policy has marked some fields the names of these fields are returned.
Parameters:
method getMissing
Get an array of required but unset form fields.
method getSecurityPolicy
object IsterHttpSecurityPolicy getSecurityPolicy(
)
|
|
Get the IsterHttpSecurityPolicy object.
method isAction
boolean isAction(
string
$name, [string
$value = null], [string
$y_val = null])
|
|
Test for a given action.
The method returns true, if the action is active. Is the additional value given, the method returns true only if the active action form field has this value.
If you test for an image button you may add an additional value $y_val (with $value considdered to be $x_val).
Parameters:
method isActionCalled
boolean isActionCalled(
)
|
|
Returns true if executeForm() has called an action.
method read
boolean read(
[boolean
$autoset = true])
|
|
Red the supplied data of the form into the IsterUIForm object.
Parameters:
method setFieldGroupChecked
boolean setFieldGroupChecked(
string
$name, array
$field)
|
|
Set a given value of a form field group as checked.
Parameters:
method setSecurityPolicy
boolean setSecurityPolicy(
object IsterHttpSecurityPolicy
&$policy, [array
$constraints = null])
|
|
Set the security policy object.
The IsterHttpSecurityPolicy object will be initialized with a number of constraints for each form field and form action. You may specify one or more default constraints that will be set for each form field.
Note: The policy must be applied explicitly outside of IsterUIForm
Parameters: