Documentation

Class: CompiledTemplate

Full name: Clarity\Engine\CompiledTemplate

Value object produced by the Clarity Compiler for a single template.

Public Properties

  • public readonly string $className ·
  • public readonly string $code ·
  • public readonly array $sourceMap ·
  • public readonly array $dependencies ·
  • public readonly array $sourceFiles ·
  • public readonly int $renderBodyLine ·
  • public readonly array $sourcePaths ·

Public methods

__construct() ·

public function __construct(string $className, string $code, array $sourceMap, array $dependencies, array $sourceFiles = [], int $renderBodyLine = 0, array $sourcePaths = []): mixed

Parameters

Name Type Default Description
$className string - Generated class name (e.g. __Clarity_f1f1fde8ef8cc7825f199f1b7bf3ad0e).
$code string - Full PHP source of the compiled file.
$sourceMap array - [phpLine, fileIndex, templateLine] mapping.
$dependencies array - [logicalName => revision] for cache invalidation.
$sourceFiles array [] Unique logical template names (parallel to $sourceMap file indices).
$renderBodyLine int 0 First line of the compiled render body.
$sourcePaths array [] Physical path per $sourceFiles entry, or [] when none.

Return value

  • Type: mixed

Back to the Index