user) { $this->redirect(url('auth/login')); } if (!$this->user->is_admin) { $this->redirect(url('/')); } } protected function getConfigs($keys) { $configs = []; foreach ($this->configs as &$value) { if (in_array($value->key, $keys)) { $configs[$value->key][] = $value; } } return $configs; } }