$val) $output[':' . $key] = $val; return $output; } public static function renderRaw(string $path, array $vars = []): string { $vars = self::prefixArray(array_merge(self::$vars, $vars)); $tpl = file_get_contents(YTKNS_TPL . '/' . $path . '.html'); $tpl = strtr($tpl, $vars); return $tpl; } public static function render(string $path, array $vars = []): void { echo self::renderRaw($path, $vars); } public static function renderSet(string $path, array $varSets = []): string { $html = ''; $tpl = file_get_contents(YTKNS_TPL . '/' . $path . '.html'); foreach($varSets as $vars) $html .= strtr($tpl, self::prefixArray($vars)); return $html; } }