ZMObject
|
+--ZMToolboxForm
public class ZMToolboxForm
extends ZMObject
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| string | addProduct(int productId, int quantity, array attr, boolean echo) Convenience function to open a form to add a given product to the shopping cart. |
| void | checked(mixed setting, mixed value, boolean default) Makes a checkbox or radio button checked. |
| string | fieldLength(string table, string col, int max, boolean echo) Create size and maxlength attributes for input fields. |
| string | hiddenCartFields(ZMShoppingCartItem item, boolean echo) Create all required hidden form fields for a given shoppin cart item. |
| string | hiddenList(string name, array values, boolean echo) Create a group of hidden form fields with a common name (ie. |
| string | idpSelect(string name, array list, string selectedId, array attr, boolean echo) Create a id/name pair based select box. |
| string | open(string page, string params, boolean secure, array attr, boolean echo) Create a HTML form tag. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public string addProduct(int productId, int quantity, array attr, boolean echo)
Convenience function to open a form to add a given product to the shopping cart.
The calling page is responsible for adding a submit button and a closing <form>
tag.
true, the URI will be echo'ed as well as returned.public void checked(mixed setting, mixed value, boolean default)
Makes a checkbox or radio button checked.
true.false.public string fieldLength(string table, string col, int max, boolean echo)
Create size and maxlength attributes for input fields.
0 to prevent a size attribute.true, the attributes will be echo'ed as well as returned.public string hiddenCartFields(ZMShoppingCartItem item, boolean echo)
Create all required hidden form fields for a given shoppin cart item.
true, the HTML will be echo'ed as well as returned.public string hiddenList(string name, array values, boolean echo)
Create a group of hidden form fields with a common name (ie. someId[]).
true, the HTML will be echo'ed as well as returned.public string idpSelect(string name, array list, string selectedId, array attr, boolean echo)
Create a id/name pair based select box.
Helper function that can create a HTML <select> tag from
any array that contains class instances that provide getId() and
getName() getter methods.
Please note that there are two special attribute keys that can be used to control the method names used to populate option value and text.
Default attributes are:
null.null.true, the HTML will be echo'ed as well as returned.<select> tag.public string open(string page, string params, boolean secure, array attr, boolean echo)
Create a HTML form tag.
The mother of all form methods.
Parameter ($params) will be added as hidden form fields, wrapped in a <div> tag.
The default method value is post.
This method will also add JavaScript validation code if the following conditions are met:
true$attr, as that will be used to lookup the validation rules.Default attributes are:
To remove any default attributes, set a value of null in the $attr parameter.
All attribute names are expected in lower case.
true.null.true, the URI will be echo'ed as well as returned.
Form related functions.