PHP Class TwigBridge\Twig\Loader

Inheritance: implements Twig_SourceContextLoaderInterfac\Twig_SourceContextLoaderInterface, implements Twig_ExistsLoaderInterfac\Twig_ExistsLoaderInterface
Mostra file Open project: rcrowe/TwigBridge Class Usage Examples

Protected Properties

Property Type Description
$cache Template lookup cache.
$extension Twig file extension.
$files Illuminate\Filesystem\Filesystem
$finder Illuminate\View\ViewFinderInterface

Public Methods

Method Description
__construct ( Illuminate\Filesystem\Filesystem $files, Illuminate\View\ViewFinderInterface $finder, string $extension = 'twig' )
exists ( $name )
findTemplate ( string $name ) : string Return path to template without the need for the extension.
getCacheKey ( $name )
getSourceContext ( $name )
isFresh ( $name, $time )

Protected Methods

Method Description
normalizeName ( string $name ) : string Normalize the Twig template name to a name the ViewFinder can use

Method Details

__construct() public method

public __construct ( Illuminate\Filesystem\Filesystem $files, Illuminate\View\ViewFinderInterface $finder, string $extension = 'twig' )
$files Illuminate\Filesystem\Filesystem The filesystem
$finder Illuminate\View\ViewFinderInterface
$extension string Twig file extension.

exists() public method

public exists ( $name )

findTemplate() public method

Return path to template without the need for the extension.
public findTemplate ( string $name ) : string
$name string Template file name or path.
return string Path to template

getCacheKey() public method

public getCacheKey ( $name )

getSourceContext() public method

public getSourceContext ( $name )

isFresh() public method

public isFresh ( $name, $time )

normalizeName() protected method

Normalize the Twig template name to a name the ViewFinder can use
protected normalizeName ( string $name ) : string
$name string Template file name.
return string The parsed name

Property Details

$cache protected_oe property

Template lookup cache.
protected $cache

$extension protected_oe property

Twig file extension.
protected $extension

$files protected_oe property

protected Filesystem,Illuminate\Filesystem $files
return Illuminate\Filesystem\Filesystem

$finder protected_oe property

protected ViewFinderInterface,Illuminate\View $finder
return Illuminate\View\ViewFinderInterface