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()); }
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; }
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); }
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); }
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); }
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(); }