Evgeny Zinoviev 6c081f3aff initial
2022-07-07 20:31:22 +03:00

20 lines
474 B
PHP

<?php
class Skin {
public string $title = 'no title';
public function renderPage($f, ...$vars): string {
$f = str_replace('/', '\\', $f);
$ctx = new SkinContext(substr($f, 0, ($pos = strrpos($f, '\\'))));
$body = call_user_func_array([$ctx, substr($f, $pos+1)], $vars);
$layout_ctx = new SkinContext('base');
return $layout_ctx->layout(
title: $this->title,
unsafe_body: $body,
);
}
}