public static function userProfile($input) { $cleanInput = DB::clean($input); $id = $cleanInput['id']; //$user = self::checkLoginStatus(); $output = ['browserTitle' => 'Användarprofil', 'page' => 'user.profile.twig', 'ads' => Ads::getUserAds($id), 'user' => Self::getUser($id)]; return $output; }
public static function dashboard() { $user = self::checkLoginStatus(); if ($user) { $output = ['browserTitle' => 'Hej och välkommen ' . $user->firstname . '!', 'page' => 'user.dashboard.twig', 'user' => $user, 'ads' => Ads::getUserAds(), 'interestingAds' => Ads::getInterestingAds()]; } else { $output = ['page' => 'home.twig']; } return $output; }