public function getTag($id)
 {
     $article = Article::getArticleListByTagId($id);
     $page = new EndaPage($article['page']);
     viewInit();
     return homeView('searchTag', ['articleList' => $article, 'tagName' => Tag::getTagNameByTagId($id), 'page' => $page]);
 }
 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function show($id)
 {
     $article = Article::getArticleModelByArticleId($id);
     ArticleStatus::updateViewNumber($id);
     $data = array('article' => $article);
     viewInit();
     return homeView('article', $data);
 }
Пример #3
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     //
     viewInit();
     $category = Category::getCatInfoModelByAsName($id);
     if (empty($category)) {
         return redirect(url(route('article.index')));
     }
     $article = Article::getNewsArticle($category->id, 10);
     return homeView('category', ['category' => $category, 'article' => $article]);
 }
Пример #4
0
 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function show($id)
 {
     //
     $userInfo = User::getUserInfoModelByUserId($id);
     if (empty($userInfo)) {
         return redirect('/');
     }
     $userArticle = Article::getArticleModelByUserId($id);
     viewInit();
     return homeView('about', ['userInfo' => $userInfo, 'userArticle' => $userArticle]);
 }
Пример #5
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     //
     $article = Article::getArticleModelByArticleId($id);
     $tags = Tag::getTagModelByTagIds($article->tags);
     $authorArticle = Article::getArticleModelByUserId($article->user_id);
     $commentList = Comment::getCommentListModel($id);
     $data = array('article' => $article, 'tags' => $tags, 'authorArticle' => $authorArticle, 'commentList' => $commentList);
     viewInit();
     return homeView('article', $data);
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     //
     $article = Article::getArticleModelByArticleId($id);
     $tags = Tag::getTagModelByTagIds($article->tags);
     $authorArticle = Article::getArticleModelByUserId($article->user_id);
     ArticleStatus::updateViewNumber($id);
     $data = array('article' => $article, 'tags' => $tags, 'authorArticle' => $authorArticle);
     viewInit();
     return homeView('article', $data);
 }
 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function show($id)
 {
     //
     viewInit();
     $category = Category::getCatInfoModelByAsName($id);
     if (empty($category)) {
         return redirect(url(route('article.index')));
     }
     $article = Article::getArticleListByCatId($category->id, 10);
     $page = new EndaPage($article['page']);
     return homeView('category', ['category' => $category, 'articleList' => $article, 'page' => $page]);
 }
Пример #8
0
function construct(&$path)
{
    if ($path == '/index' or $path == '/home' or $path == '/') {
        homeView();
    } else {
        if ($path == '/about') {
            aboutView();
        } else {
            if ($path == '/create') {
                createView();
            } else {
                if (strpos($path, '/posts/') !== false) {
                    postView($path);
                } else {
                    if ($path == '/login') {
                        loginView();
                    } else {
                        if ($path == '/search') {
                            searchView();
                        } else {
                            if ($path == '/admin/settings') {
                                adminView();
                            } else {
                                if ($path == '/admin/dashboard') {
                                    adminDashboardView();
                                } else {
                                    if ($path == '/logout') {
                                        logout();
                                    } else {
                                        errorView('404 Not Found', errorMessage);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
Пример #9
0
 public function getTag($id)
 {
     $article = Article::getArticleListByTagId($id);
     viewInit();
     return homeView('searchTag', ['article' => $article, 'tagName' => Tag::getTagNameByTagId($id)]);
 }