$args Variáveis disponíveis no template em `$resgata_args`. */ public static function render( string $name, array $args = array() ): string { $path = self::locate( $name ); if ( '' === $path ) { return ''; } ob_start(); self::include_template( $path, $args ); return (string) ob_get_clean(); } /** * Imprime um template. Cada template escapa os próprios valores. * * @param string $name Nome do arquivo de template. * @param array $args Variáveis disponíveis no template em `$resgata_args`. */ public static function display( string $name, array $args = array() ): void { $path = self::locate( $name ); if ( '' !== $path ) { self::include_template( $path, $args ); } } /** * Inclui o template em um escopo isolado. * * @param string $resgata_path Caminho do template. * @param array $resgata_args Variáveis do template. */ private static function include_template( string $resgata_path, array $resgata_args ): void { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed -- Usada pelo template incluído. include $resgata_path; } }