public function get_view() { $articles = null; $message = "show all"; $orderby = 'id'; if (isset($_GET['sortby'])) { $orderby = $_GET['sortby']; } if (isset($_GET['filterby'])) { if ($_GET['filterby'] === "tag") { $articles = cmsHelper::getAllArticlesByTagUrl($_GET['value'], $message, $orderby); } else { if ($_GET['filterby'] === "category") { $articles = cmsHelper::getAllArticlesByCategoryUrl($_GET['value'], $message, $orderby); } else { if ($_GET['filterby'] === "author") { $articles = cmsHelper::getAllArticlesByAuthorId($_GET['value'], $message, $orderby); } else { if ($_GET['filterby'] === "status") { $articles = cmsHelper::getAllArticlesByStatus($_GET['value'], $message, $orderby); } else { if ($_GET['filterby'] === "search") { $articles = cmsHelper::getAllArticlesBySearch($_GET['value'], $message, $orderby); } } } } } } else { $articles = cmsHelper::getAllArticles($message, false, $orderby); } $filterdQueryStringArray = array(); $output = null; parse_str($_SERVER['QUERY_STRING'], $filterdQueryStringArray); unset($filterdQueryStringArray['page']); $output = $filterdQueryStringArray; unset($filterdQueryStringArray['sortby']); return View::make("admin.ArticleMgt.list", array('articles' => $articles, 'message' => $message, 'filterdQueryString' => cmsHelper::getArrayToString($filterdQueryStringArray), 'filterdQueryStringArray' => $output)); }