Overview

Namespaces

  • Charcoal
    • View
      • Mustache
      • Php
      • Twig

Classes

  • AssetsHelpers
  • MustacheEngine
  • MustacheLoader
  • TranslatorHelpers

Interfaces

  • HelpersInterface
  • Overview
  • Namespace
  • Class

Class MustacheEngine

Mustache view rendering engine.

Charcoal\View\AbstractEngine implements Charcoal\View\EngineInterface, Psr\Log\LoggerAwareInterface uses Psr\Log\LoggerAwareTrait (not available)
Extended by Charcoal\View\Mustache\MustacheEngine
Namespace: Charcoal\View\Mustache
Located at Charcoal/View/Mustache/MustacheEngine.php
Methods summary
public string
# type( )

Returns

string
public
# __construct( array $data )

Build the Mustache Engine with an array of dependencies.

Build the Mustache Engine with an array of dependencies.

Parameters

$data
Engine dependencie.

Overrides

Charcoal\View\AbstractEngine::__construct()
protected Mustache_Engine
# mustache( )

Returns

Mustache_Engine
protected Mustache_Engine
# createMustache( )

Returns

Mustache_Engine
public Charcoal\View\Mustache\MustacheEngine
# setHelpers( array|Traversable|Charcoal\View\Mustache\HelpersInterface $helpers )

Set the engine's helpers.

Set the engine's helpers.

Parameters

$helpers
Mustache helpers.

Returns

Charcoal\View\Mustache\MustacheEngine
Chainable

Throws

InvalidArgumentException
If the given helper(s) are invalid.
public Charcoal\View\Mustache\MustacheEngine
# mergeHelpers( array|Traversable|Charcoal\View\Mustache\HelpersInterface $helpers )

Merge (replacing or adding) the engine's helpers.

Merge (replacing or adding) the engine's helpers.

Parameters

$helpers
Mustache helpers.

Returns

Charcoal\View\Mustache\MustacheEngine
Chainable

Throws

InvalidArgumentException
If the given helper(s) are invalid.
public Charcoal\View\Mustache\MustacheEngine
# addHelper( string $name, mixed $helper )

Add a helper.

Add a helper.

Parameters

$name
The tag name.
$helper
The tag value.

Returns

Charcoal\View\Mustache\MustacheEngine
Chainable
public array
# helpers( )

Retrieve the engine's helpers.

Retrieve the engine's helpers.

Returns

array
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.

Overrides

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

Parameters

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

Returns

string
The rendered template string.
Methods inherited from Charcoal\View\AbstractEngine
loadTemplate(), loader()
API documentation generated by ApiGen