DEV: Настройки (админ-панель)

This commit is contained in:
Evg 2022-10-08 20:26:20 +03:00
parent 0ed6f3d2af
commit 2781038421

View file

@ -8,6 +8,8 @@ use Meta;
class Setting
{
private static $cache = [];
public function index($type)
{
return view(
@ -15,8 +17,8 @@ class Setting
[
'meta' => Meta::get(__('admin.' . $type)),
'data' => [
'type' => $type,
'settings' => SettingModel::get(),
'type' => $type,
'settings' => SettingModel::get(),
]
]
);
@ -36,4 +38,19 @@ class Setting
is_return(__('msg.change_saved'), 'success', url('admin.settings.general'));
}
public function get($key)
{
if (self::$cache) {
foreach (self::$cache as $val)
{
$settings[$val['val']] = $val['value'];
}
return $settings[$key];
}
self::$cache = SettingModel::get();
}
}