request_model = $this->load->model('request'); } public function get_data(): ?array { $uid = $this->request_model->get_int('id', FALSE); if ($uid === FALSE) { if ($this->main->session) { $uid = $this->main->user()['id']; } else { return NULL; } } $user = $this->db ->select('*') ->from('api.user u') ->where('u.id') ->eq($uid) ->row(); if (!$user) { return NULL; } $data = parent::get_data(); $data['user'] = $user; $data['title'] = lang('title', sub: [$user['first_name']]); return $data; } }