ZMObject
└─ZMView
└─ZMRedirectView
public class ZMRedirectView
extends ZMView
| Field Summary | |
|---|---|
| protected mixed | |
| protected mixed | |
| protected mixed | |
| protected mixed | |
| protected mixed | |
| Method Summary | |
|---|---|
| void | Create a new redirect view. |
| string | asUrl(mixed request, mixed template, string type, string filename, request The) {@inheritDoc} |
| boolean | exists(mixed request, mixed template, string type, string filename, request The) {@inheritDoc} |
| string | fetch(mixed request, string template, mixed type, request The) {@inheritDoc} |
| string | {@inheritDoc} |
| string | Get the request id of the redirect. |
| ZMViewUtils | {@inheritDoc} |
| boolean | {@inheritDoc} |
| string | path(mixed template, string type, string filename) {@inheritDoc} |
| void | setParameter(string parameter) Set additional parameter. |
| void | setRequestId(string requestId) Set the request id. |
| void | setSecure(boolean secure) Set secure flag. |
| void | setStatus(int status) Set alternative status code. |
| void | setUrl(string url) Set a url. |
| Methods inherited from org.zenmagick.mvc.view\ZMView | |
|---|---|
| __construct, asUrl, exists, fetch, generate, getContentType, getEncoding, getTemplate, getVar, getVars, getViewId, getViewUtils, isValid, path, setTemplate, setVar, setVars, setViewId | |
| Methods inherited from org.zenmagick.core\ZMObject | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
protected mixed $parameter_
protected mixed $requestId_
protected mixed $secure_ = TEMPLATE
protected mixed $status_
protected mixed $url_
public void __construct()
Create a new redirect view.
public string asUrl(mixed request, mixed template, string type, string filename, request The)
Resolve the given (relative) templates filename into a url.
ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.public boolean exists(mixed request, mixed template, string type, string filename, request The)
Check if the given templates file exists.
ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.true if the file exists, false if not.public string fetch(mixed request, string template, mixed type, request The)
Fetch/generate the contents of the given template.
public string generate(ZMRequest request)
Shortcut to generate the contents for the currenty set template.
The template extension is taken from the 'zenmagick.mvc.templates.ext'
public string getRequestId()
Get the request id of the redirect.
If not set, this will default to the template name (compatibility mode).
public ZMViewUtils getViewUtils()
Get view utils.
ZMViewUtils or null.public boolean isValid(ZMRequest request)
Check if this view is valid.
This is optional and it is up to the specific subclass to implement as appropriate.
true if the view is valid.public string path(mixed template, string type, string filename)
Resolve the given templates filename to a fully qualified filename.
ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.null.public void setParameter(string parameter)
Set additional parameter.
public void setRequestId(string requestId)
Set the request id.
public void setSecure(boolean secure)
Set secure flag.
true to create a secure redirect.public void setStatus(int status)
Set alternative status code.
Allows to set an alternative 3xx status code for the redirect.
public void setUrl(string url)
Set a url.
Setting a url will override the view. The URL will be used as is.
Redirect view.
The redirect URL may be set by explicitely setting a url or a request Id. If a request Id is set, a full URL will be created.