/** * Update a timeperiod * * @method post * @route /timeperiod/update */ public function updateAction() { $params = $this->getParams('post')->all(); $router = Di::getDefault()->get('router'); /* Save information */ try { TimePeriodRepository::update($params, 'form', $this->getUri()); } catch (\Exception $e) { return $router->response()->json(array('success' => false, 'error' => $e->getMessage())); } return $router->response()->json(array('success' => true)); }