\AnaxView

Traits

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

Interfaces

ViewRenderFileInterface Render a view based on a template file and a dataset.

Classes

Exception Anax base class for wrapping sessions.
View A view connected to a template file.
View2 A view connected to a template file, supporting Anax DI.
ViewCollection A view collection supporting Anax DI, store all views per region, render at will.
ViewContainer A view container, store all views per region, render at will.
ViewRenderFile Render a view based on a template file and a dataset.
ViewRenderFile2 Render a view based on a template file and a dataset.

Functions

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.

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

currentRoute()

currentRoute() : string

Get current route.

Returns

string —

as resulting route.

currentUrl()

currentUrl() : string

Get current url, without querystring.

Returns

string —

as resulting url.

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

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

showEnvironment()

showEnvironment(array  $variables, array  $functions) : string

Show variables/functions that are currently defined and can be used within the view. Call the function with get_defined_vars() as the parameter.

Parameters

array $variables

should be the returned value from get_defined_vars()

array $functions

should be the returned value from get_defined_functions()

Returns

string —

showing variables and functions.

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.