當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Board::posts方法代碼示例

本文整理匯總了PHP中app\Board::posts方法的典型用法代碼示例。如果您正苦於以下問題:PHP Board::posts方法的具體用法?PHP Board::posts怎麽用?PHP Board::posts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Board的用法示例。


在下文中一共展示了Board::posts方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getBoardHistory

 public function getBoardHistory(Board $board, Post $post)
 {
     $posts = $board->posts()->with('op')->withEverything()->where('author_ip', $post->author_ip)->orderBy('post_id', 'desc')->paginate(15);
     foreach ($posts as $item) {
         $item->setRelation('board', $board);
     }
     return $this->view(static::VIEW_HISTORY, ['posts' => $posts, 'multiboard' => false]);
 }
開發者ID:GodOfConquest,項目名稱:infinity-next,代碼行數:8,代碼來源:HistoryController.php

示例2: getPost

 /**
  * Returns a post to the client. 
  *
  * @var Board $board
  * @var Post  $post
  * @return Response
  */
 public function getPost(Board $board, Post $post)
 {
     // Pull the post.
     $post = $board->posts()->where('board_id', $post)->withEverything()->firstOrFail();
     if (!$post) {
         return abort(404);
     }
     return $post;
 }
開發者ID:JEWSbreaking8chan,項目名稱:infinity-next,代碼行數:16,代碼來源:BoardController.php

示例3: getBoardHistory

 public function getBoardHistory(Board $board, Post $post)
 {
     if (!$this->user->canViewHistory($post)) {
         return abort(403);
     }
     $posts = $board->posts()->with('op')->withEverything()->where('author_ip', $post->author_ip)->orderBy('post_id', 'desc')->paginate(15);
     foreach ($posts as $item) {
         $item->setRelation('board', $board);
     }
     return $this->view(static::VIEW_HISTORY, ['posts' => $posts, 'multiboard' => false, 'ip' => ip_less($post->author_ip->toText())]);
 }
開發者ID:LulzNews,項目名稱:infinity-next,代碼行數:11,代碼來源:HistoryController.php

示例4: getPost

 /**
  * Redirect from a local id to a thread OP..
  *
  * @param  Board $board
  * @param  integer $thread
  * @return Redirect
  */
 public function getPost(Board $board, $post)
 {
     if (is_null($post)) {
         return redirect($board->board_uri);
     }
     // Check to see if the thread exists.
     $post = $board->posts()->where('board_id', $post)->get()->first();
     if (!$post) {
         return abort(404);
     }
     if ($post->reply_to) {
         return redirect("{$board->board_uri}/thread/{$post->reply_to_board_id}#{$post->board_id}");
     }
     return redirect("{$board->board_uri}/thread/{$post->board_id}");
 }
開發者ID:nitogel,項目名稱:infinity-next,代碼行數:22,代碼來源:BoardController.php


注:本文中的app\Board::posts方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。