/** * Render the profile page * @param $username */ public static function profile($username) { # fetch account data by username $account = Accounts::findByUsername($username); # fecth all categories $categories = Categories::all(); # fetch all of this member's post $posts = Posts::find(['id_account' => $account['id']]); # fetch all accounts $users = Accounts::find(['type' => 2]); View::render('member/profile', ['account' => $account, 'posts' => $posts, 'users' => $users, 'categories' => $categories]); }