public function editAction(Tags $tag) { if ($this->request->isPost() && $tag->update($this->request->getPost())) { return $this->success(); } $this->view->mytag = $tag; $this->view->form = myForm::buildFormFromModel($tag); }
public function editAction(Sites $site) { if ($this->request->isPost()) { $data = $this->request->getPost(); // dd($data); $site->update($data); $this->redirectByRoute(['for' => 'sites.show', 'site' => $site->id]); } $this->view->site = $site; $this->view->form = myForm::buildFormFromModel($site); }
public function editAction(Files $file) { $fileable = $file->getFileable(); if ($this->request->isPost()) { $data = $this->request->getPost(); // dd($data); if (isset($data['file_id'])) { $fileable->update($data); //更新fileable数据表 $file_data = myParser::getParserFromModel($fileable, $data)->getDataForFile(); $file_data['type'] = $data['type']; $file->update($file_data); return $this->success(); } $file->update($this->request->getPost()); return $this->success(); } $this->view->file = $file; if ($fileable == null) { $fileable = $file; } $this->view->form = myForm::buildFormFromModel($fileable, ['type']); }
public function editSerialAction(Movies $movie, Serials $serial) { if ($this->request->isPost()) { $serial->update($this->request->getPost()); $tvserial = $serial->getTVSerial(); return $this->redirectByRoute(['for' => 'tvserials.show', 'tvserial' => $tvserial->id]); } $this->view->serial = $serial; $this->view->form = myForm::buildFormFromModel($serial); $this->view->movie = $movie; }