Example #1
0
 public function showItemAction(Tags $tag, Files $file)
 {
     $this->view->mytag = $tag;
     $this->view->page = $tag->getShowItemPage($file);
     $this->view->file = $file;
     $this->view->form = myForm::buildCommentForm($file->getTaggable($tag)->getFirst());
 }
Example #2
0
 public function showTagAction(Users $user, Tags $tag, $page = 1)
 {
     $this->view->mytag = $tag;
     $this->view->page = $this->getPaginator($tag->getTaggedFiles($user), 25, $page);
     $this->view->form = myForm::buildCommentForm($tag);
     //这个应该去掉
     $this->view->user = $user;
 }
Example #3
0
 public function editCommentAction(Sites $site, Comments $comment)
 {
     if ($this->request->isPost()) {
         $comment->update($this->request->getPost());
         $this->redirectByRoute(['for' => 'sites.show', 'site' => $site->id]);
     }
     $this->view->comment = $comment;
     $this->view->form = myForm::buildCommentForm($site, $comment);
 }
Example #4
0
 public function editCommentAction(Episodes $episode, Comments $comment)
 {
     if ($this->request->isPost()) {
         $comment->update($this->request->getPost());
         return $this->redirectByRoute(['for' => 'movies.showEpisode', 'movie' => $episode->getMovie()->id, 'episode' => $episode->id]);
     }
     $this->view->comment = $comment;
     $this->view->form = myForm::buildCommentForm($episode, $comment);
 }
Example #5
0
 public function editCommentAction(Files $file, Comments $comment)
 {
     if ($this->request->isPost()) {
         $data = $this->request->getPost();
         if ($comment->update($data)) {
             return $this->success();
         }
         dd('评论更新失败');
     }
     $this->view->file = $file;
     $this->view->comment = $comment;
     $this->view->form = myForm::buildCommentForm($file, $comment);
 }
Example #6
0
 public function showEpisodeAction(Movies $movie, Episodes $episode)
 {
     //        dd($movie->getEpisodes());
     //        dd((new Carbon())->createFromTimestamp(strtotime($episode->date))->format('l, M d Y'));
     //        $episodes = Episodes::find();
     //        foreach($episodes as $e){
     //            $e->date=(new Carbon())->createFromTimestamp(strtotime($e->date))->toDateTimeString();
     //            $e->save();
     //        };
     $this->view->movie = $movie;
     $this->view->episode = $episode;
     $this->view->form = myForm::buildCommentForm($episode);
     $this->view->comments = $episode->comments();
 }