public function postEnvironment() { $this->InstallWizard->saveNewApplicationKey(); $environment = $this->Input->get('environment') === 'custom' ? $this->Input->get('custom_environment') : $this->Input->get('environment'); $this->InstallWizard->saveEnvironment($environment); if ($this->InstallWizard->errors) { return $this->Redirect->to('install/environment')->withErrors($this->InstallWizard->errors)->with('message-errors', 'Error')->withInput(); } return $this->Redirect->to('install/database'); }