PHP Class Bolt\Twig\FilesystemLoader

Author: Carson Full ([email protected])
Inheritance: extends Twig_Loader_Filesystem
Show file Open project: bolt/bolt Class Usage Examples

Protected Properties

Property Type Description
$filesystem Bolt\Filesystem\FilesystemInterface

Public Methods

Method Description
__construct ( Bolt\Filesystem\FilesystemInterface $filesystem, array | string $paths = [] ) Constructor.
addDir ( Bolt\Filesystem\Handler\DirectoryInterface $dir, string $namespace = self::MAIN_NAMESPACE ) Adds a directory where templates are stored.
addPath ( $path, $namespace = self::MAIN_NAMESPACE )
getCacheKey ( $name )
getSource ( $name )
getSourceContext ( $name )
isFresh ( $name, $time )
prependDir ( Bolt\Filesystem\Handler\DirectoryInterface $dir, string $namespace = self::MAIN_NAMESPACE ) Prepends a directory where templates are stored.
prependPath ( $path, $namespace = self::MAIN_NAMESPACE )

Protected Methods

Method Description
findTemplate ( string $name, boolean $throw = true ) : Bolt\Filesystem\Handler\FileInterface | false Finds a file given the template name.

Method Details

__construct() public method

Constructor.
public __construct ( Bolt\Filesystem\FilesystemInterface $filesystem, array | string $paths = [] )
$filesystem Bolt\Filesystem\FilesystemInterface The filesystem to use
$paths array | string A path or an array of paths where to look for templates

addDir() public method

Adds a directory where templates are stored.
public addDir ( Bolt\Filesystem\Handler\DirectoryInterface $dir, string $namespace = self::MAIN_NAMESPACE )
$dir Bolt\Filesystem\Handler\DirectoryInterface
$namespace string

addPath() public method

public addPath ( $path, $namespace = self::MAIN_NAMESPACE )

findTemplate() protected method

Finds a file given the template name.
protected findTemplate ( string $name, boolean $throw = true ) : Bolt\Filesystem\Handler\FileInterface | false
$name string The template name.
$throw boolean Whether to throw exceptions or return false.
return Bolt\Filesystem\Handler\FileInterface | false

getCacheKey() public method

public getCacheKey ( $name )

getSource() public method

public getSource ( $name )

getSourceContext() public method

public getSourceContext ( $name )

isFresh() public method

public isFresh ( $name, $time )

prependDir() public method

Prepends a directory where templates are stored.
public prependDir ( Bolt\Filesystem\Handler\DirectoryInterface $dir, string $namespace = self::MAIN_NAMESPACE )
$dir Bolt\Filesystem\Handler\DirectoryInterface
$namespace string

prependPath() public method

public prependPath ( $path, $namespace = self::MAIN_NAMESPACE )

Property Details

$filesystem protected property

protected FilesystemInterface,Bolt\Filesystem $filesystem
return Bolt\Filesystem\FilesystemInterface