From 6c081f3aff64689ed3b77bfeec1d2e0005fe5286 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Thu, 7 Jul 2022 20:31:22 +0300 Subject: initial --- skin/base.skin.php | 15 +++++++++++++++ skin/main.skin.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 skin/base.skin.php create mode 100644 skin/main.skin.php (limited to 'skin') diff --git a/skin/base.skin.php b/skin/base.skin.php new file mode 100644 index 0000000..d5e02e2 --- /dev/null +++ b/skin/base.skin.php @@ -0,0 +1,15 @@ + + + + {$title} + + {$unsafe_body} + +HTML; +} diff --git a/skin/main.skin.php b/skin/main.skin.php new file mode 100644 index 0000000..f44f739 --- /dev/null +++ b/skin/main.skin.php @@ -0,0 +1,29 @@ + + + {$ctx->if_true($show_cities, 'line of truth
')} + {$ctx->if_not(false, $ctx->renderIfFalse, 'safe', 'unsafe')} + +
    + {$ctx->for_each($cities, fn($city, $i) => $ctx->renderIndexCityItem($city, $i+1))} +
+HTML; +} + +function renderIndexCityItem($ctx, $city, $index) { +return <<{$index} {$city} +HTML; +} + +function renderIfFalse($ctx, $str, $unsafe_str) { +return << +unsafe: $unsafe_str +HTML; +} \ No newline at end of file -- cgit v1.2.3