\Charcoal\ViewGenericView

Concrete implementation of a _View_ interface (extends `AbstractView`).

Also implements the ConfigurableInterface

Summary

Methods
Properties
Constants
__construct()
loadTemplate()
render()
renderTemplate()
No public properties found
No constants found
engine()
No protected properties found
N/A
setEngine()
$engine
N/A

Properties

Methods

__construct()

__construct(array  $data) 

Build the object with an array of dependencies.

Parameters:

  • logger a PSR-3 logger

Parameters

array $data

View class dependencies.

Throws

\InvalidArgumentException

If required parameters are missing.

loadTemplate()

loadTemplate(string  $templateIdent) : string

Load a template (from identifier).

Parameters

string $templateIdent

The template identifier to load..

Throws

\InvalidArgumentException

If the template ident is not a string.

Returns

string

render()

render(string  $templateIdent, mixed  $context = null) : string

Load a template (from identifier) and render it.

Parameters

string $templateIdent

The template identifier, to load and render.

mixed $context

The view controller (rendering context).

Returns

string

renderTemplate()

renderTemplate(string  $templateString, mixed  $context = null) : string

Render a template (from string).

Parameters

string $templateString

The full template string to render.

mixed $context

The view controller (rendering context).

Returns

string

setEngine()

setEngine(\Charcoal\View\EngineInterface  $engine) : void

Set the engine (`EngineInterface`) dependency.

Parameters

\Charcoal\View\EngineInterface $engine

The rendering engine.