ZenMagick 0.9.10


org.zenmagick.mvc.view\ZMRedirectView
mvc\view\ZMRedirectView.php at line 33

Class ZMRedirectView

ZMObject
└─ZMView
└─ZMRedirectView

public class ZMRedirectView
extends ZMView

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.

Author:
DerManoMann

Field Summary
protected mixed

$parameter_

protected mixed

$requestId_

protected mixed

$secure_

protected mixed

$status_

protected mixed

$url_

Method Summary
void

__construct()

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

generate(ZMRequest request)

{@inheritDoc}

string

getRequestId()

Get the request id of the redirect.

ZMViewUtils

getViewUtils()

{@inheritDoc}

boolean

isValid(ZMRequest request)

{@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

Field Detail

mvc\view\ZMRedirectView.php at line 36

parameter_

protected mixed $parameter_

mvc\view\ZMRedirectView.php at line 38

requestId_

protected mixed $requestId_

mvc\view\ZMRedirectView.php at line 34

secure_

protected mixed $secure_ = TEMPLATE

mvc\view\ZMRedirectView.php at line 37

status_

protected mixed $status_

mvc\view\ZMRedirectView.php at line 35

url_

protected mixed $url_

Method Detail

mvc\view\ZMRedirectView.php at line 44

__construct

public void __construct()

Create a new redirect view.


mvc\view\ZMRedirectView.php at line 78

asUrl

public string asUrl(mixed request, mixed template, string type, string filename, request The)

Resolve the given (relative) templates filename into a url.

Parameters:
The - current request.
filename - The filename, relative to the template path.
type - The lookup type; valid values are ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.
Returns:
A url.

mvc\view\ZMRedirectView.php at line 71

exists

public boolean exists(mixed request, mixed template, string type, string filename, request The)

Check if the given templates file exists.

Parameters:
The - current request.
filename - The filename, relative to the template path.
type - The lookup type; valid values are ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.
Returns:
true if the file exists, false if not.

mvc\view\ZMRedirectView.php at line 64

fetch

public string fetch(mixed request, string template, mixed type, request The)

Fetch/generate the contents of the given template.

Parameters:
The - current request.
template - The template name.
Returns:
The contents.

mvc\view\ZMRedirectView.php at line 106

generate

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'

Parameters:
request - The current request.
Returns:
The contents.

mvc\view\ZMRedirectView.php at line 175

getRequestId

public string getRequestId()

Get the request id of the redirect.

If not set, this will default to the template name (compatibility mode).

Returns:
The request id.

mvc\view\ZMRedirectView.php at line 99

getViewUtils

public ZMViewUtils getViewUtils()

Get view utils.

Returns:
An instance of ZMViewUtils or null.

mvc\view\ZMRedirectView.php at line 92

isValid

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.

Parameters:
request - The current request.
Returns:
true if the view is valid.

mvc\view\ZMRedirectView.php at line 85

path

public string path(mixed template, string type, string filename)

Resolve the given templates filename to a fully qualified filename.

Parameters:
filename - The filename, relative to the template path.
type - The lookup type; valid values are ZMView::TEMPLATE and ZMView::RESOURCE; default is ZMVIew::TEMPLATE.
Returns:
A fully qualified filename or null.

mvc\view\ZMRedirectView.php at line 124

setParameter

public void setParameter(string parameter)

Set additional parameter.

Parameters:
parameter - Parameter string in URL query format.

mvc\view\ZMRedirectView.php at line 164

setRequestId

public void setRequestId(string requestId)

Set the request id.

Parameters:
requestId - Request id of the redirect URL.

mvc\view\ZMRedirectView.php at line 133

setSecure

public void setSecure(boolean secure)

Set secure flag.

Parameters:
secure - true to create a secure redirect.

mvc\view\ZMRedirectView.php at line 155

setStatus

public void setStatus(int status)

Set alternative status code.

Allows to set an alternative 3xx status code for the redirect.

Parameters:
status - HTTP status code.

mvc\view\ZMRedirectView.php at line 144

setUrl

public void setUrl(string url)

Set a url.

Setting a url will override the view. The URL will be used as is.

Parameters:
url - A full URL.

ZenMagick 0.9.10