render($template, $data); } /** * Returns core object * * @return Core */ function core(): Core { return Core::get(); } /** * Returns app object * * @return App */ function app(): App { return Core::get()->app(); } /** * Returns any value as boolean * * @param mixed $value * @return bool */ function bool(mixed $value): bool { is_string($value) && $value = strtolower(trim($value)); if (in_array($value, [true, 1, '1', '+', 'y', 'yes', 'on', 'true', 'enable', 'enabled'], true)) { return true; } if (in_array($value, [false, 0, '0', '-', 'n', 'no', 'off', 'false', 'disable', 'disabled'], true)) { return false; } return (bool)$value; } /** * Get config values * * @param string $key * @param mixed|null $default * @return mixed */ function config(string $key, mixed $default = null): mixed { return Core::get()->config($key, $default); } /** * Get Redis instance * * @return Redis */ function redis(): Redis { return Core::get()->redis(); } /** * Get ini-file instance * * @return IniFile */ function ini(): IniFile { return Core::get()->ini(); }