当前位置: 首页>>代码示例>>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;未经允许,请勿转载。