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); }
} // end process(); public function view() { if ($this->invalid()) { $this->tpl->assign('error_msg', 1); } $this->tpl->parse('test_forms_3.tpl'); } } try { require './include.php'; $tpl = new optClass(); $tpl->loadConfig('./config.php'); $tpl->setMasterPage('master.tpl'); $validator = new opfValidator(); $opf = new opfClass($tpl, $validator->defaultParams()); $opf->createI18n('./'); $form = new myForm($opf, 'form1'); if ($form->execute()) { $tpl->assign('username', $opf->validator->username); $tpl->assign('email', $opf->validator->email); $tpl->assign('age', $opf->validator->age); $tpl->assign('content', $opf->validator->content); $tpl->parse('report.tpl'); } } catch (opfException $exception) { opfErrorHandler($exception); } catch (optException $exception) { optErrorHandler($exception); }
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); }
if (isset($userTable[$this->validator->username]) && $userTable[$this->validator->username] == $this->validator->password) { return true; } $this->setError('username', 'opf', 'invaliduser'); return false; } } try { require './include.php'; $tpl = new optClass(); $tpl->loadConfig('./config.php'); $tpl->setMasterPage('master.tpl'); $validator = new opfValidator(); $opf = new opfClass($tpl, $validator->defaultParams()); $opf->createI18n('./'); $form = new myForm($opf, 'form1'); if ($form->execute()) { $tpl->assign('username', $validator->username); $tpl->assign('email', $validator->email); $tpl->assign('age', $validator->age); $tpl->assign('content', $validator->content); $tpl->parse('report.tpl'); } else { if ($form->invalid()) { $tpl->assign('error_msg', 1); } $tpl->parse('test_forms_1.tpl'); } } catch (opfException $exception) { opfErrorHandler($exception); } catch (optException $exception) {
public function addToListAction(Movies $movie, $page = 0) { $this->view->movie = $movie; $this->view->page = $this->getPaginator(Lists::find(), 25, $page); $this->view->listForm = myForm::buildListForm($movie); $this->view->relatedLists = $movie->getRelatedLists(); $this->view->lists = $movie->getNotRelatedLists($this->view->relatedLists); }