ZMObject
└─ZMController
public class ZMController
extends ZMObject
| Fields inherited from org.zenmagick.core.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
ZMController(string id) Create new instance. |
|
| Method Summary | |
|---|---|
| ZMView | findView(string id, array data, array parameter) Lookup the appropriate view for the given name. |
| ZMObject | getFormData(ZMRequest request) Get the form data object (if any) for this request. |
| string | getId() Get the controller id. |
| ZMView | getView() Get the current view. |
| boolean | isFormSubmit(ZMRequest request) Check if this request is a form submit. |
| void | preProcess(ZMRequest request) Convenience method for request processing shared by request methods. |
| ZMView | Process a HTTP request. |
| ZMView | processGet(ZMRequest request) Process a HTTP GET request. |
| ZMView | processPost(ZMRequest request) 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(ZMRequest request, string formId, mixed formData) Validate the current request using the given rule id. |
| protected ZMView | validateFormData(ZMRequest request, mixed formData) Validate the given form bean. |
| protected ZMView | validateSession(ZMRequest request) Validate session token. |
| Methods inherited from org.zenmagick.core.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public ZMController(string id)
Create new instance.
null to use the request id.public ZMView findView(string id, array data, array parameter)
Lookup the appropriate view for the given name.
null to return to the current page.null.public ZMObject getFormData(ZMRequest request)
Get the form data object (if any) for this request.
nullpublic string getId()
Get the controller id.
public ZMView getView()
Get the current view.
null.public boolean isFormSubmit(ZMRequest request)
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 void preProcess(ZMRequest request)
Convenience method for request processing shared by request methods.
Despite the name this is called as part of the controllers process($request) method.
That ensures that all processing is within the boundaries of a single transaction (if enabled).
public ZMView process(ZMRequest request)
Process a HTTP request.
Supported request methods are GET and POST.
This method should not be overridded!.
ZMView instance or null.public ZMView processGet(ZMRequest request)
Process a HTTP GET request.
ZMView that handles presentation or null if the controller generates the contents itself.public ZMView processPost(ZMRequest request)
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(ZMRequest request, string formId, mixed formData)
Validate the current request using the given rule id.
ZMRuleSet id.null for all current request parameter.true if the validation was successful, false if not.protected ZMView validateFormData(ZMRequest request, mixed formData)
Validate the given form bean.
null for success.protected ZMView validateSession(ZMRequest request)
Validate session token.
null for success.
Request controller base class.