ZMObject
|
+--ZMController
public class ZMController
extends ZMObject
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
ZMController(string id) Create new instance. |
|
| Method Summary | |
|---|---|
| void | exportGlobal(string name, mixed instance) Export the given object under the given name. |
| ZMView | findView(string id, array parameter) Lookup the appropriate view for the given name. |
| ZMView | Get the form bean (if any) for this request. |
| void | getGlobal(string name, mixed instance) Returns the named global. |
| array | Returns a name => object hash of variables that need to be exported into the theme space. |
| string | getId() Get the controller id. |
| ZMView | getView() Get the current view. |
| void | Generic callback for request processing independant from the method. |
| boolean | Check if this request is a form submit. |
| ZMView | process() Process a HTTP request. |
| ZMView | Process a HTTP GET request. |
| ZMView | Process a HTTP POST request. |
| void | setContentType(string type, string charset) Set the response content type. |
| void | setId(string id) Set the controller id. |
| void | Set the current view. |
| boolean | validate(string id, mixed req) Validate the current request using the given rule id. |
| protected ZMView | validateFormBean(mixed formBean) Validate the given form bean. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public ZMController(string id)
Create new instance.
null to use the request name.public void exportGlobal(string name, mixed instance)
Export the given object under the given name.
Controller may use this method to make objects available to the response template/view.
public ZMView findView(string id, array parameter)
Lookup the appropriate view for the given name.
null to return to the current page.null.public ZMView getFormBean()
Get the form bean (if any) for this request.
public void getGlobal(string name, mixed instance)
Returns the named global.
null.public array getGlobals()
Returns a name => object hash of variables that need to be exported
into the theme space.
name => object for all variables
* that need to be exported into the theme space.public string getId()
Get the controller id.
public ZMView getView()
Get the current view.
null.public void handleRequest()
Generic callback for request processing independant from the method. /
public boolean isFormSubmit()
Check if this request is a form submit.
This default implementation will return true for all POST requests.
true if this is a form submit request.public ZMView process()
Process a HTTP request.
Supported request methods are GET and POST.
ZMView instance or null.public ZMView processGet()
Process a HTTP GET request.
ZMView that handles presentation or null
* if the controller generates the contents itself.public ZMView processPost()
Process a HTTP POST request.
ZMView that handles presentation or null
* if the controller generates the contents itself.public void setContentType(string type, string charset)
Set the response content type.
null will omit the charset part.public void setId(string id)
Set the controller id.
public void setView(ZMView view)
Set the current view.
null.public boolean validate(string id, mixed req)
Validate the current request using the given rule id.
ZMRuleSet id.null to default to $_POST.true if the validation was successful, false if not.protected ZMView validateFormBean(mixed formBean)
Validate the given form bean.
null for success.
Request controller base class.