public function profileAction() { $fc = FrontController::getInstance(); $model = new FrontModel(); $userModel = new UserTableModel(); $userModel->setTable('user'); $id = filter_var($fc->getParams()['id'], FILTER_SANITIZE_NUMBER_INT); if (!$id || $id !== Session::get('user_id')) { header('Location: /'); exit; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { } else { $manager = $userModel->getUserProfileManager($id); $userProfile = $manager->getFullUserProfile(); $model->setData(['profile' => $userProfile]); $output = $model->render('../views/user/profile.php', 'withoutSliderAndSidebar'); $fc->setPage($output); } }