\Anax\ViewCViewContainerBasic

A view container, store all views per region, render at will.

Summary

Methods
Properties
Constants
setDI()
add()
addCallback()
addString()
setFileSuffix()
setBasePath()
hasContent()
render()
No public properties found
No constants found
No protected methods found
$di
N/A
No private methods found
$views
$suffix
$path
N/A

Properties

$di

$di : 

Properties

Type

$views

$views : 

Properties

Type

$suffix

$suffix : 

Type

$path

$path : 

Type

Methods

setDI()

setDI(\Anax\DI\class  $di) : $this

Set the service container to use

Parameters

\Anax\DI\class $di

a service container

Returns

$this

add()

add(string  $template, array  $data = array(), string  $region = 'main', integer  $sort) : $this

Add a view to be included as a template file.

Parameters

string $template

the name of the template file to include

array $data

variables to make available to the view, default is empty

string $region

which region to attach the view

integer $sort

which order to display the views

Returns

$this

addCallback()

addCallback(string  $callback, array  $data = array(), string  $region = 'main', integer  $sort) : $this

Add a callback to be rendered as a view.

Parameters

string $callback

function to call to get the content of the view

array $data

variables to make available to the view, default is empty

string $region

which region to attach the view

integer $sort

which order to display the views

Returns

$this

addString()

addString(string  $content, string  $region = 'main', integer  $sort) : $this

Add a string as a view.

Parameters

string $content

the content

string $region

which region to attach the view

integer $sort

which order to display the views

Returns

$this

setFileSuffix()

setFileSuffix(string  $suffix) : $this

Set the suffix of the template files to include.

Parameters

string $suffix

file suffix of template files, append to filenames for template files

Returns

$this

setBasePath()

setBasePath(string  $path) : $this

Set base path where to find views.

Parameters

string $path

where all views reside

Returns

$this

hasContent()

hasContent(string  $region) : $this

Check if a region has views to render.

Parameters

string $region

which region to check

Returns

$this

render()

render(string  $region = 'main') : $this

Render all views for a specific region.

Parameters

string $region

which region to use

Returns

$this