Engine
class Engine
Templating engine Latte.
Constants
| Version |
|
| VersionId |
|
| deprecated VERSION |
|
| deprecated VERSION_ID |
|
| CONTENT_HTML |
|
| CONTENT_XML |
|
| CONTENT_JS |
|
| CONTENT_CSS |
|
| CONTENT_ICAL |
|
| CONTENT_TEXT |
|
Methods
No description
Renders template to output.
Renders template to string.
Creates template object.
Compiles template to PHP code.
Parses template to AST node.
Compiles template to cache.
Returns the file path where compiled template will be cached.
Returns the PHP class name for compiled template.
Generates unique hash for template based on current configuration.
Returns values that determine isolation for different configurations.
No description
Returns all run-time filters.
Call a run-time filter.
No description
Registers run-time function.
Call a run-time function.
No description
Adds new provider.
Returns all providers.
No description
No description
No description
No description
Sets path to temporary directory.
Sets auto-refresh mode.
Enables declare(strict_types=1) in templates.
No description
No description
Sets the locale. It uses the same identifiers as the PHP intl extension.
No description
No description
Sets default Latte syntax. Available options: 'single', 'double', 'off'
No description
Details
at line 68
__construct()
No description
at line 83
void
render(string $name, object|array $params = [], string|null $block = null)
Renders template to output.
at line 95
string
renderToString(string $name, object|array $params = [], string|null $block = null)
Renders template to string.
at line 107
Template
createTemplate(string $name, array $params = [], bool $clearCache = true)
Creates template object.
at line 125
string
compile(string $name)
Compiles template to PHP code.
at line 157
TemplateNode
parse(string $template)
Parses template to AST node.
at line 178
void
applyPasses(TemplateNode $node)
Calls node visitors.
at line 196
string
generate(TemplateNode $node, string $name)
Generates compiled PHP code.
at line 208
void
warmupCache(string $name)
Compiles template to cache.
at line 239
string
getCacheFile(string $name)
Returns the file path where compiled template will be cached.
at line 248
string
getTemplateClass(string $name)
Returns the PHP class name for compiled template.
at line 259
string
generateTemplateHash(string $name)
| internal |
Generates unique hash for template based on current configuration.
Used to create isolated cache files for different engine configurations.
at line 271
protected array
generateConfigurationSignature()
Returns values that determine isolation for different configurations.
When any of these values change, a new compiled template is created to avoid conflicts.
at line 289
Engine
addFilter(string $name, callable $callback)
Registers run-time filter.
at line 300
Engine
addFilterLoader(callable $loader)
No description
at line 313
array
getFilters()
Returns all run-time filters.
at line 323
mixed
invokeFilter(string $name, array $args)
Call a run-time filter.
at line 351
array
getExtensions()
No description
at line 360
Engine
addFunction(string $name, callable $callback)
Registers run-time function.
at line 375
mixed
invokeFunction(string $name, array $args)
Call a run-time function.
at line 384
array
getFunctions()
No description
at line 393
Engine
addProvider(string $name, mixed $provider)
Adds new provider.
at line 408
array
getProviders()
Returns all providers.
at line 414
Engine
setPolicy(Policy|null $policy)
No description
at line 421
Policy|null
getPolicy(bool $effective = false)
No description
at line 429
Engine
setExceptionHandler(callable $handler)
No description
at line 436
Engine
setSandboxMode(bool $state = true)
No description
at line 443
Engine
setContentType(string $type)
No description
at line 453
Engine
setTempDirectory(string|null $path)
Sets path to temporary directory.
at line 463
Engine
setAutoRefresh(bool $state = true)
Sets auto-refresh mode.
at line 473
Engine
setStrictTypes(bool $state = true)
Enables declare(strict_types=1) in templates.
at line 480
Engine
setStrictParsing(bool $state = true)
No description
at line 487
bool
isStrictParsing()
No description
at line 496
Engine
setLocale(string|null $locale)
Sets the locale. It uses the same identifiers as the PHP intl extension.
at line 506
string|null
getLocale()
No description
at line 519
Loader
getLoader()
No description
at line 525
Engine
enablePhpLinter(string|null $phpBinary)
No description
at line 535
Engine
setSyntax(string $syntax)
Sets default Latte syntax. Available options: 'single', 'double', 'off'
at line 542
Engine
setMigrationWarnings(bool $state = true)
No description