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 AbstractEngine

Default implementation, as abstract class, of the EngineInterface.

View Engines are comprised of 2 things: - A template loader, wich is a LoaderInterfaceObject - Set with set_loader() / Get with loader() - Provides loadtemplate() method - A render() method, which takes a $template and a $context arguments

Engines implements the LoggerAwareInterface. A logger can be accessed with the logger() method.

Charcoal\View\AbstractEngine implements Charcoal\View\EngineInterface, Psr\Log\LoggerAwareInterface uses Psr\Log\LoggerAwareTrait (not available)

Direct known subclasses

Charcoal\View\Mustache\MustacheEngine, Charcoal\View\Php\PhpEngine, Charcoal\View\Twig\TwigEngine
Abstract
Namespace: Charcoal\View
Located at Charcoal/View/AbstractEngine.php
Methods summary
abstract public string
# type( )

Returns

string
public
# __construct( array $data )

Build the object with an array of dependencies.

Build the object with an array of dependencies.

Required parameters:

  • logger a PSR-3 logger

Optional parameters:

  • loader a Loader object

Parameters

$data
Engine dependencie.
protected Charcoal\View\LoaderInterface
# loader( )

Returns

Charcoal\View\LoaderInterface
public string
# loadTemplate( string $templateIdent )

Delegates template loading to the engine's Loader object.

Delegates template loading to the engine's Loader object.

Parameters

$templateIdent
The template identifier to load.

Returns

string
The template string, loaded from identifier.

Implementation of

Charcoal\View\EngineInterface::loadTemplate()
public string
# render( string $templateIdent, mixed $context )

Parameters

$templateIdent
The template identifier to load and render.
$context
The rendering context.

Returns

string
The rendered template string.

Implementation of

Charcoal\View\EngineInterface::render()
abstract public string
# renderTemplate( string $templateString, mixed $context )

Parameters

$templateString
The template string to render.
$context
The rendering context.

Returns

string
The rendered template string.

Implementation of

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