public function viewCategory() { $session = new SessionHelper(); if ($this->_authCheck()) { // Instance used for data on page $user = new User(); // Id of the category $id = htmlspecialchars($_GET['id']); // Instance used for data on page $category = new Category($id); // Posts for this category $postsmodel = new PostModel(); $posts = $postsmodel->getTopPostsByCategoryId($id); // Load the views $page_title = $category->title; include BASE_URI . 'app/view/user/template/header.php'; include BASE_URI . 'app/view/category/category.php'; include BASE_URI . 'app/view/user/template/footer.php'; } else { $this->viewLoginPage(); } }