DEV: Настройки (админ-панель)
This commit is contained in:
parent
0ed6f3d2af
commit
2781038421
1 changed files with 19 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue