Methods |
public
|
__construct()
|
#
|
public
|
render(string $name, object|mixed[] $params = [], ?string $block = null): void
Renders template to output.
Renders template to output.
|
#
|
public
|
renderToString(string $name, object|mixed[] $params = [], ?string $block = null): string
Renders template to string.
Renders template to string.
|
#
|
public
|
createTemplate(string $name, mixed[] $params = [], $clearCache = true): Template
|
#
|
public
|
compile(string $name): string
Compiles template to PHP code.
Compiles template to PHP code.
|
#
|
public
|
parse(string $template): TemplateNode
Parses template to AST node.
Parses template to AST node.
|
#
|
public
|
applyPasses(TemplateNode &$node): void
|
#
|
public
|
generate(TemplateNode $node, string $name): string
Generates compiled PHP code.
Generates compiled PHP code.
|
#
|
public
|
warmupCache(string $name): void
Compiles template to cache.
Compiles template to cache.
Throws
|
#
|
public
|
getCacheFile(string $name): string
|
#
|
public
|
getTemplateClass(string $name): string
|
#
|
protected
|
getCacheKey(): array
Values that affect the results of compilation and the name of the cache file.
Values that affect the results of compilation and the name of the cache file.
|
#
|
protected
|
getCacheSignature(string $name): array
Values that check the expiration of the compiled template.
Values that check the expiration of the compiled template.
|
#
|
public
|
addFilter(string $name, callable $callback): static
Registers run-time filter.
Registers run-time filter.
|
#
|
public
|
addFilterLoader(callable $loader): static
|
#
|
public
|
getFilters(): callable[]
Returns all run-time filters.
Returns all run-time filters.
|
#
|
public
|
invokeFilter(string $name, mixed[] $args): mixed
|
#
|
public
|
addExtension(Extension $extension): static
|
#
|
public
|
getExtensions(): Extension[]
|
#
|
public
|
addFunction(string $name, callable $callback): static
Registers run-time function.
Registers run-time function.
|
#
|
public
|
invokeFunction(string $name, mixed[] $args): mixed
Call a run-time function.
Call a run-time function.
|
#
|
public
|
getFunctions(): callable[]
|
#
|
public
|
addProvider(string $name, mixed $provider): static
|
#
|
public
|
getProviders(): mixed[]
|
#
|
public
|
setPolicy(?Policy $policy): static
|
#
|
public
|
getPolicy(bool $effective = false): ?Policy
|
#
|
public
|
setExceptionHandler(callable $handler): static
|
#
|
public
|
setSandboxMode(bool $state = true): static
|
#
|
public
|
setContentType(string $type): static
|
#
|
public
|
setTempDirectory(?string $path): static
Sets path to temporary directory.
Sets path to temporary directory.
|
#
|
public
|
setAutoRefresh(bool $state = true): static
|
#
|
public
|
setStrictTypes(bool $state = true): static
Enables declare(strict_types=1) in templates.
Enables declare(strict_types=1) in templates.
|
#
|
public
|
setStrictParsing(bool $state = true): static
|
#
|
public
|
isStrictParsing(): bool
|
#
|
public
|
setLocale(?string $locale): static
Sets the locale. It uses the same identifiers as the PHP intl extension.
Sets the locale. It uses the same identifiers as the PHP intl extension.
|
#
|
public
|
getLocale(): ?string
|
#
|
public
|
setLoader(Loader $loader): static
|
#
|
public
|
getLoader(): Loader
|
#
|
public
|
enablePhpLinter(?string $phpBinary): static
|
#
|
public
|
__get(string $name)
|
#
|