예제 #1
0
 public function __invoke(Update $updater)
 {
     $redirect = null;
     if ($updater->getValid()) {
         if ($updater->getUseSessionMessage()) {
             $this->flashMessenger()->addSuccessMessage($updater->getFormattedSuccessMessage());
         }
         $redirect = $this->url()->fromRoute($updater->getSuccessRedirectRouteName(), $updater->getSuccessRedirectRouteParams(), $updater->getSuccessRedirectRouteOptions());
     } else {
         // set error
         /* @var $response \Zend\Http\PhpEnvironment\Response */
         $response = $this->getService('Response');
         $response->setStatusCode(Response::STATUS_CODE_400);
     }
     return array('success' => $updater->getValid(), 'messages' => $updater->getErrorMessages(), 'models' => $updater->getEntitiesAsJson(), 'redirect' => $redirect);
 }
예제 #2
0
 protected function update(Params $params, UpdateService $updateService)
 {
     $updateService->update($params);
     return new JsonModel($this->fzyUpdateResult($updateService));
 }
예제 #3
0
파일: Base.php 프로젝트: fousheezy/form
 public function reset()
 {
     $this->formMap = array();
     return parent::reset();
 }