Overview

Namespaces

  • Charcoal
    • View
      • Mustache
      • Php
      • Twig

Classes

  • AbstractEngine
  • AbstractLoader
  • AbstractView
  • GenericView
  • Renderer
  • ViewConfig
  • ViewServiceProvider

Interfaces

  • EngineInterface
  • LoaderInterface
  • ViewableInterface
  • ViewInterface

Traits

  • ViewableTrait
  • Overview
  • Namespace
  • Class

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)

Direct known subclasses

Charcoal\View\GenericView
Abstract
Namespace: Charcoal\View
Located at Charcoal/View/AbstractView.php
Methods summary
public
# __construct( array $data )

Build the object with an array of dependencies.

Build the object with an array of dependencies.

Parameters:

  • logger a PSR-3 logger

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

Charcoal\View\EngineInterface
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

Charcoal\View\ViewInterface::loadTemplate()
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

Charcoal\View\ViewInterface::render()
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

Charcoal\View\ViewInterface::renderTemplate()
API documentation generated by ApiGen