Constants

FACADE

FACADE

Facade for rendering fallback.

Properties

$options

$options : array

Rendering options.

Type

array

$paths

$paths : array

Templates directories.

Type

array

$cacheDirectory

$cacheDirectory : string

Cache directory.

Type

string

Methods

__construct()

__construct(array  $options = array()) 

Parameters

array $options

resolve()

resolve(string  $file) : boolean|null|string

Resolve a template file path.

Parameters

string $file

Returns

boolean|null|string

isExpired()

isExpired(string  $file,   $cachePath = null) : boolean

Returns true is a template file is expired, false else.

$cachePath will be set with the template cache file path.

Parameters

string $file
$cachePath

Returns

boolean

displayFile()

displayFile(string  $__pug_file, array  $__pug_parameters = array()) 

Display a template.

Parameters

string $__pug_file
array $__pug_parameters

renderFile()

renderFile(string  $file, array  $parameters = array()) : string

Returns a rendered template file.

Parameters

string $file

file path

array $parameters

local variables

Returns

string

call()

call(string  $name, array  $arguments = array(), array  $options = array()) : mixed

Call an optimizer method statically.

Parameters

string $name

method name

array $arguments

method argument to be passed

array $options

options the optimizer will be created with

Returns

mixed

hashPrint()

hashPrint(string  $input) : string

Return a hashed print from input file or content.

Parameters

string $input

Returns

string

getRegistryPathChunks()

getRegistryPathChunks(string  $source, integer|null  $directoryIndex = null) : \Phug\Renderer\Partial\iterable

Yield list of path chunks for registry for a given path.

Parameters

string $source
integer|null $directoryIndex

Returns

\Phug\Renderer\Partial\iterable

getFirstRegistryIndex()

getFirstRegistryIndex(array|null  $registry) : string|false

Return the first value indexed with "i:" prefix as raw cash path.

Parameters

array|null $registry

registry result

Returns

string|false

findCachePathInRegistry()

findCachePathInRegistry(string  $path, array  $registry, array<mixed,string>  $extensions = array()) : string|false

Find the path of a cached file for a given path in a given registry.

Parameters

string $path

path to find in the registry

array $registry

registry data array

array<mixed,string> $extensions

extensions to try to add to the file path if not found

Returns

string|false

findCachePathInRegistryFile()

findCachePathInRegistryFile(string  $path, string  $registryFile, array<mixed,string>  $extensions = array()) : string|false

Find the path of a cached file for a given path in a given registry file (that may not exist).

Parameters

string $path

path to find in the registry

string $registryFile

registry file path

array<mixed,string> $extensions

extensions to try to add to the file path if not found

Returns

string|false

getSourceAndCachePaths()

getSourceAndCachePaths(string  $file) : \Phug\[string,

Returns [sourcePath, cachePath] for a given file.

Parameters

string $file

Returns

\Phug\[string, —

string]

getExtensions()

getExtensions() : array<mixed,string>

Get list of extensions to try.

Returns

array<mixed,string>

tryExtensionsOnFileKey()

tryExtensionsOnFileKey(array  $registry, string  $key, array<mixed,string>  $extensions) : boolean|mixed

Try to append extension to find a key in a given array if it's file registry key.

Parameters

array $registry
string $key
array<mixed,string> $extensions

Returns

boolean|mixed

tryExtensions()

tryExtensions(array  $registry, string  $key, array<mixed,string>  $extensions) : boolean|mixed

Try to append extension to find a key in a given array assuming it's file registry key.

Parameters

array $registry
string $key
array<mixed,string> $extensions

Returns

boolean|mixed

findInRegistry()

findInRegistry(string  $path, array  $registry, array<mixed,string>  $extensions) : string|array|false

Find raw entry of a cached file for a given path in a given registry.

Parameters

string $path

path to find in the registry

array $registry

registry data array

array<mixed,string> $extensions

extensions to try to add to the file path if not found

Returns

string|array|false

hasExpiredImport()

hasExpiredImport(  $sourcePath,   $cachePath) : boolean

Returns true if the path has an expired imports linked.

Parameters

$sourcePath
$cachePath

Returns

boolean

getCachePath()

getCachePath(string  $name) : string

Get PHP cached file for a given name.

Parameters

string $name

Returns

string

getRawCachePath()

getRawCachePath(  $file) : string

Get PHP cached file for a given file basename.

Parameters

$file

Returns

string

getRegistryPath()

getRegistryPath(string  $path) : string|false

Get path from the cache registry (if up_to_date_check set to false only).

Parameters

string $path

required view path.

Returns

string|false —

false if no path registred, the path else.