ZMObject
└─ZMToolboxTool
└─ZMToolboxForm
public class ZMToolboxForm
extends ZMToolboxTool
| Fields inherited from org.zenmagick.mvc.toolbox\ZMToolboxTool | |
|---|---|
| request_, toolbox_ | |
| Fields inherited from org.zenmagick.core\ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| string | addProduct(int productId, int quantity, array attr) Convenience function to open a form to add a given product to the shopping cart. |
| void | checked(boolean setting, boolean value, boolean default) Makes a checkbox or radio button checked. |
| string | fieldLength(string table, string col, int max) Create size and maxlength attributes for input fields. |
| void | hidden(mixed data) Create hidden elements from the given map or query args. |
| string | hiddenCartFields(ZMShoppingCartItem item) Create all required hidden form fields for a given shoppin cart item. |
| string | hiddenList(string name, array values) Create a group of hidden form fields with a common name (ie. |
| string | idpSelect(string name, array list, string selectedId, array attr) Create a id/name pair based select box. |
| void | insertJSValidation(string id) Convenience method that will generate the JavaScript validation rules and include the generic validation code. |
| string | open(string page, string params, boolean secure, array attr) Create a HTML form tag. |
| Methods inherited from org.zenmagick.mvc.toolbox\ZMToolboxTool | |
|---|---|
| __construct, getRequest, getToolbox, setRequest, setToolbox | |
| Methods inherited from org.zenmagick.core\ZMObject | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
public string addProduct(int productId, int quantity, array attr)
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.
public void checked(boolean setting, boolean value, boolean default)
Makes a checkbox or radio button checked.
true.false.public string fieldLength(string table, string col, int max)
Create size and maxlength attributes for input fields.
0 to prevent a size attribute.public void hidden(mixed data)
Create hidden elements from the given map or query args.
public string hiddenCartFields(ZMShoppingCartItem item)
Create all required hidden form fields for a given shoppin cart item.
public string hiddenList(string name, array values)
Create a group of hidden form fields with a common name (ie. someId[]).
public string idpSelect(string name, array list, string selectedId, array attr)
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.<select> tag.public void insertJSValidation(string id)
Convenience method that will generate the JavaScript validation rules and include the generic validation code.
ZMRuleSet name).public string open(string page, string params, boolean secure, array attr)
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.
Form related functions.