public function edit() { $statconfTable = new Table\StatConfTable(); if ($this->request->is('get')) { $query = $this->request->query; //$this->autoRender = false; $this->set(['config' => $query]); } elseif ($this->request->is('post')) { $data = $this->request->data; $key = $data['key']; $value = $data['value']; $updateConfig = $statconfTable->updateConfig($key, $value); if ($updateConfig) { $statConfDto = new DTO\ClsStatConfigDto($key, $value); $syncController = new SyncController(); $syncController->statConfEntry(json_encode($statConfDto), UPDATE); } $this->redirect(['controller' => 'ConfigurationForm', 'action' => 'index']); } else { die('Request Error Occured !! please try later'); } }