profile_model = $this->load_model('profile'); $this->people_controller = $this->load_controller('people'); $this->post_controller = $this->load_controller('_post'); $this->load_lang('profile'); } public function index(): void { $id = $this->get_int('id'); parent::index(); $data = $this->profile_model->get_data(); // profile does not exist if (!$data) { // not logged in and trying to access own profile if (!$id) $this->redirect('/auth/login'); // directly accessing unknown user id => 404 else $this->error(404); } $this->view('header', $data); $this->view('profile/main', $data); $this->view('footer', $data); } } ?>