\Anax\ViewViewHelperTrait

Trait with view helpers, provided by the ThemeEngine to the views.

Summary

Methods
Properties
Constants
asset()
url()
renderView()
regionHasContent()
renderRegion()
classList()
currentUrl()
currentRoute()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

asset()

asset(string  $url = "") : string

Shortcut to create an url for a static asset.

Parameters

string $url

url to use when creating the url.

Returns

string —

as resulting url.

url()

url(null|string  $url = "") : string

Shortcut to create an url for routing in the framework.

Parameters

null|string $url

url to use when creating the url.

Returns

string —

as resulting url.

renderView()

renderView(string  $template, array  $data = array()) : void

Render a view with an optional data set of variables.

Parameters

string $template

the template file, or array

array $data

variables to make available to the view, default is empty

regionHasContent()

regionHasContent(string  $region) : boolean

Check if the region in the view container has views to render.

Parameters

string $region

to check

Returns

boolean —

true or false

renderRegion()

renderRegion(string  $region) : boolean

Render views, from the view container, in the region.

Parameters

string $region

to render in

Returns

boolean —

true or false

classList()

classList(string|array  $args) : string

Create a class attribute from a string or array.

Parameters

string|array $args

variable amount of classlists.

Returns

string —

as complete class attribute

currentUrl()

currentUrl() : string

Get current url, without querystring.

Returns

string —

as resulting url.

currentRoute()

currentRoute() : string

Get current route.

Returns

string —

as resulting route.