$extensions
$extensions : array
List of global extensions. Class names that add custom behaviors to the engine.
$options : \Phug\OptionsBundle
$renderer : \Phug\Renderer
The current rendering instance used for ::compile(File,Directory), ::render(File,Directory), ::display(File).
$rendererClassName : \Phug\Renderer
Rendering class to be used to create the renderer engine.
setRendererClassName(string $rendererClassName)
Set the engine class used to render templates.
string | $rendererClassName | class name of the custom renderer engine |
** File not found : Phug::setRendererClassName(\Tale\Pug\Renderer::class) **
** File not found : Phug::setRendererClassName(\Pug\Pug::class) **
getRenderer(array $options = array()) : \Phug\Renderer
Get a renderer with global options and argument options merged.
array | $options |
** File not found : Phug::getRenderer([]) **
setFilter(string $name, callable|string $filter)
Set a filter to the Phug facade (will be available in the current renderer instance and next static calls).
Throws an exception if the filter is not callable and do not have a parse method.
string | $name | |
callable|string | $filter |
setKeyword(string $name, callable|string $keyword)
Set a keyword to the Phug facade (will be available in the current renderer instance and next static calls).
Throws an exception if the keyword is not callable.
string | $name | |
callable|string | $keyword |
cacheDirectory(string|array $source, string|null $destination = null, array|null $options = null) : array
Cache a whole directory and return an array with [$successCount, $errorCount, $errorDetails].
string|array | $source | input directories containing pug files |
string|null | $destination | output for compiled PHP files (if array given, will be used as options array) |
array|null | $options | optional options |
textualCacheDirectory(string $source, string|null $destination = null, array|null $options = null) : string
Same method as cacheDirectory but with textual human-friendly output.
string | $source | input directories containing pug files |
string|null | $destination | output for compiled PHP files (if array given, will be used as options array) |
array|null | $options | optional options |