Overview

Namespaces

  • Charcoal
    • View
      • Mustache
      • Php
      • Twig

Classes

  • TwigEngine
  • TwigLoader
  • Overview
  • Namespace
  • Class

Class TwigLoader

The Charcoal View Twig Loader implements both Twig_LoaderInterface and its own LoaderInterface.

Charcoal\View\AbstractLoader implements Psr\Log\LoggerAwareInterface, Charcoal\View\LoaderInterface uses Psr\Log\LoggerAwareTrait (not available)
Extended by Charcoal\View\Twig\TwigLoader implements Charcoal\View\LoaderInterface, Twig_LoaderInterface
Namespace: Charcoal\View\Twig
Located at Charcoal/View/Twig/TwigLoader.php
Methods summary
protected string
# filenameFromIdent( string $ident )

Convert an identifier to a file path.

Convert an identifier to a file path.

Parameters

$ident
The identifier to convert.

Returns

string
public string
# getSource( string $name )

Twig_LoaderInterface > getSource()

Twig_LoaderInterface > getSource()

Gets the source code of a template, given its name.

Parameters

$name
The name of the template to load.

Returns

string
The template source code.
public Twig_Source
# getSourceContext( string $name )

Twig_LoaderInterface > getSourceContext()

Twig_LoaderInterface > getSourceContext()

Gets the source code of a template, given its name. For Twig 2.x

Parameters

$name
The name of the template to load.

Returns

Twig_Source
The template source object.
public boolean
# exists( string $name )

Twig_LoaderInterface > exists()

Twig_LoaderInterface > exists()

For Twig 2.x

Parameters

$name
The name of the template to load.

Returns

boolean
public string
# getCacheKey( string $name )

Twig_LoaderInterface > getCacheKey()

Twig_LoaderInterface > getCacheKey()

Gets the cache key to use for the cache for a given template name.

Parameters

$name
The name of the template to load.

Returns

string
The cache key
public boolean
# isFresh( string $name, integer $time )

Twig_LoaderInterface > isFresh()

Twig_LoaderInterface > isFresh()

Returns true if the template is still fresh.

Parameters

$name
The template name.
$time
The last modification time of the cached template.

Returns

boolean
Methods inherited from Charcoal\View\AbstractLoader
__construct(), basePath(), findTemplateFile(), load(), paths()
API documentation generated by ApiGen