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 AbstractLoader

Base template loader.

Charcoal\View\AbstractLoader implements Psr\Log\LoggerAwareInterface, Charcoal\View\LoaderInterface uses Psr\Log\LoggerAwareTrait (not available)

Direct known subclasses

Charcoal\View\Mustache\MustacheLoader, Charcoal\View\Php\PhpLoader, Charcoal\View\Twig\TwigLoader
Abstract
Namespace: Charcoal\View
Located at Charcoal/View/AbstractLoader.php
Methods summary
public
# __construct( array $data = null )

Default constructor, if none is provided by the concrete class implementations.

Default constructor, if none is provided by the concrete class implementations.

Required dependencies

  • logger A PSR-3 logger

Parameters

$data
The class dependencies map.
public string
# load( string $ident )

Load a template content

Load a template content

Parameters

$ident
The template ident to load and render.

Returns

string

Throws

InvalidArgumentException
If the dynamic template identifier is not a string.

Implementation of

Charcoal\View\LoaderInterface::load()
protected string
# basePath( )

Returns

string
protected string[]
# paths( )

Returns

string[]

See

FileLoader::path()
protected string|null
# findTemplateFile( string $ident )

Get the template file (full path + filename) to load from an ident.

Get the template file (full path + filename) to load from an ident.

This method first generates the filename for an identifier and search for it in all of the loader's paths.

Parameters

$ident
The template identifier to load.

Returns

string|null
The full path + filename of the found template. Null if nothing was found.

Throws

InvalidArgumentException
If the template ident is not a string.
abstract protected string
# filenameFromIdent( string $ident )

Parameters

$ident
The template identifier to convert to a filename.

Returns

string
API documentation generated by ApiGen