ZenMagick 0.9.10


org.zenmagick.mvc.utils\ZMViewUtils
mvc\utils\ZMViewUtils.php at line 29

Class ZMViewUtils

ZMObject
└─ZMViewUtils

public class ZMViewUtils
extends ZMObject

View utils.

Author:
DerManoMann

Constant Summary
final static str

FOOTER

final static str

HEADER

final static str

NOW

Fields inherited from org.zenmagick.core\ZMObject
properties_
Method Summary
void

__construct(ZMView view)

Create new instance.

void

cssFile(string filename, boolean inline, array attr)

Add link to the given CSS file or create inline CSS in the head element of the response.

array

getResourceContents()

Process all resources.

ZMView

getView()

Get the associated view.

string

handleResourceGroup(mixed files, string group, string location, array Resource)

Handle all resources of a given group and location.

void

jsFile(string filename, string position, boolean inline)

Add the given JavaScript file to the final contents or create script reference (default).

string

resolveResource(string filename, ZMView view)

Resolve resource path.

Methods inherited from org.zenmagick.core\ZMObject
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Constant Detail

mvc\utils\ZMViewUtils.php at line 31
public final static str FOOTER = 'footer'

mvc\utils\ZMViewUtils.php at line 30
public final static str HEADER = 'header'

mvc\utils\ZMViewUtils.php at line 32

NOW

public final static str NOW = 'now'

Method Detail

mvc\utils\ZMViewUtils.php at line 42

__construct

public void __construct(ZMView view)

Create new instance.

Parameters:
view - The current view.

mvc\utils\ZMViewUtils.php at line 73

cssFile

public void cssFile(string filename, boolean inline, array attr)

Add link to the given CSS file or create inline CSS in the head element of the response.

Parameters:
filename - A relative CSS filename.
inline - Optional flag that can be used to control whether to create a link or insert CSS inline; default is false to link.
attr - Optional attribute map; special keys 'prefix' and 'suffix' may be used to wrap.

mvc\utils\ZMViewUtils.php at line 183

getResourceContents

public array getResourceContents()

Process all resources.

Returns:
Final contents for header and footer or null.

mvc\utils\ZMViewUtils.php at line 61

getView

public ZMView getView()

Get the associated view.

Returns:
The view.

mvc\utils\ZMViewUtils.php at line 144

handleResourceGroup

public string handleResourceGroup(mixed files, string group, string location, array Resource)

Handle all resources of a given group and location.

Parameters:
Resource - details.
group - The group; either css or js.
location - The location; either ZMViewUtils::HEADER or ZMViewUtils::FOOTER.
Returns:
The final content ready to be injected into the final contents.

mvc\utils\ZMViewUtils.php at line 88

jsFile

public void jsFile(string filename, string position, boolean inline)

Add the given JavaScript file to the final contents or create script reference (default).

Parameters:
filename - A relative JavaScript filename.
inline - Optional flag that can be used to control whether to create a link or insert JavaScript inline; default is false to link.
position - Optional position; either HEADER (default), FOOTER or NOW.

mvc\utils\ZMViewUtils.php at line 131

resolveResource

public string resolveResource(string filename, ZMView view)

Resolve resource path.

This default implementation does nothing but return the result of: $view->asUrl($request, $filename, ZMView::RESOURCE);.

Parameters:
filename - The (relative) path to the resource.
view - The current view.
Returns:
The resolved final URL.

ZenMagick 0.9.10