コード例 #1
0
ファイル: IndexController.php プロジェクト: pnaq57/zf2demo
 public function addAction()
 {
     if ($this->request->isPost()) {
         $user = new User();
         $user->setFullName($this->getRequest()->getPost('fullname'));
         $this->getObjectManager()->persist($user);
         $this->getObjectManager()->flush();
         $newId = $user->getId();
         return $this->redirect()->toRoute('home');
     }
     return new ViewModel();
 }