diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-07-09 19:40:17 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-07-09 19:40:17 +0300 |
commit | f7bfdf58def6aadc922e1632f407d1418269a0d7 (patch) | |
tree | d7a0b2819e6a26c11d40ee0b27267ea827fbb345 /engine/SkinBase.php |
initial
Diffstat (limited to 'engine/SkinBase.php')
-rw-r--r-- | engine/SkinBase.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/engine/SkinBase.php b/engine/SkinBase.php new file mode 100644 index 0000000..b50c172 --- /dev/null +++ b/engine/SkinBase.php @@ -0,0 +1,22 @@ +<?php + +class SkinBase implements LangAccess { + + protected static LangData $ld; + + public static function __constructStatic(): void { + self::$ld = LangData::getInstance(); + } + + public function lang(...$args): string { + return htmlescape($this->langRaw(...$args)); + } + + public function langRaw(string $key, ...$args) { + $val = self::$ld[$key]; + return empty($args) ? $val : sprintf($val, ...$args); + } + +} + +SkinBase::__constructStatic();
\ No newline at end of file |