* @license https://files.froxlor.org/misc/COPYING.txt GPLv2 */ use Froxlor\Language; use Froxlor\UI\Request; function view($template, $attributes) { $view = file_get_contents(dirname(__DIR__) . '/templates/' . $template); return str_replace(array_keys($attributes), array_values($attributes), $view); } function lng(string $identifier, array $arguments = []) { return Language::getTranslation($identifier, $arguments); } function old(string $identifier, string $default = null, string $session = null) { if ($session && isset($_SESSION[$session])) { return $_SESSION[$session][$identifier] ?? $default; } return Request::get($identifier, $default); }