NaifyView\Compiler\CompiledTemplatePathResolver クラス
CompiledTemplatePathResolver — compiled mainline の Compiled Template Path Resolver
template を generated PHP class へ落とす compile pipeline の一部。 大きな compiler へ責務を押し込まず、source 生成・依存計画・fast path などを小さく分ける。
使用例
// Engine が warm-hit できない template を compiled artifact へ変換する時に使う。
// 通常は View / Engine 経由で呼ばれ、アプリ側から直接操作しない。
プロパティ
| 名前 | 型 | 説明 |
|---|---|---|
private
$templateRoots
|
array |
compile-time include/layout resolution roots |
private
$resolvedLookups
|
array |
メソッド
| メソッド | 説明 |
|---|---|
public
resetResolvedLookups(): void
|
|
public
getResolvedLookups(): array
|
|
private
recordResolvedLookup(string $source, string $currentTemplatePath, string $resolvedPath): string
|
|
public
__construct(array $templateRoots = '...'): void
|
インスタンスを初期化する |
public
setTemplateRoots(array $templateRoots): void
|
`setTemplateRoots()` の値を設定する |
public
getTemplateRoots(): array
|
`getTemplateRoots()` の値を返す |
public
resolveCompiledIncludePath(string $source, string $currentTemplatePath): string
|
`resolveCompiledIncludePath()` を実行する |
private
buildPathNotFoundException(string $source, string $currentTemplatePath): NaifyViewException
|
|
private
isWithinTemplateRoots(string $resolvedPath): bool
|
解決済みパスが設定済み template root の内側にあるかを返す |
public
buildDisplayTemplatePath(string $resolvedPath): string
|
`buildDisplayTemplatePath()` を実行する |
private
normalizeTemplateRoots(array $templateRoots): array
|
`normalizeTemplateRoots()` を実行する |