Class AbstractView
Base abstract class for View interfaces, implements ViewInterface
.
Also implements the ConfigurableInterface
-
Charcoal\View\AbstractView
implements
Psr\Log\LoggerAwareInterface,
Charcoal\View\ViewInterface
uses
Psr\Log\LoggerAwareTrait (not available)
Methods summary
public
|
#
__construct( array $data )
Build the object with an array of dependencies.
Build the object with an array of dependencies.
Parameters:
Parameters
- $data
- View class dependencies.
Throws
InvalidArgumentException If required parameters are missing.
|
protected
Charcoal\View\EngineInterface
|
#
engine( )
Get the view's rendering engine instance.
Get the view's rendering engine instance.
Returns
|
public
string
|
#
loadTemplate( string $templateIdent )
Load a template (from identifier).
Load a template (from identifier).
Parameters
- $templateIdent
- The template identifier to load..
Returns
string
Throws
InvalidArgumentException If the template ident is not a string.
Implementation of
|
public
string
|
#
render( string $templateIdent, mixed $context = null )
Load a template (from identifier) and render it.
Load a template (from identifier) and render it.
Parameters
- $templateIdent
- The template identifier, to load and render.
- $context
- The view controller (rendering context).
Returns
string
Implementation of
|
public
string
|
#
renderTemplate( string $templateString, mixed $context = null )
Render a template (from string).
Render a template (from string).
Parameters
- $templateString
- The full template string to render.
- $context
- The view controller (rendering context).
Returns
string
Implementation of
|