From 33948d56c1eca2f0823a2002bfea1af06a1f28b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Mon, 24 Mar 2025 16:49:51 +0900 Subject: [PATCH] cfmgrv4 init...10 --- app/Controllers/CommonController.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/app/Controllers/CommonController.php b/app/Controllers/CommonController.php index 8dc8421..d0a4981 100644 --- a/app/Controllers/CommonController.php +++ b/app/Controllers/CommonController.php @@ -116,16 +116,20 @@ abstract class CommonController extends BaseController $this->create_init('create'); return $this->create_form_procedure(); } + protected function create_form_process_result(): string + { + return view( + $this->view_path . "create", + data: ['viewDatas' => $this->getViewDatas()] + ); + } final protected function create_form_procedure(): RedirectResponse|string { try { helper(['form']); $this->create_form_process(); $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; - return view( - $this->view_path . "create", - data: ['viewDatas' => $this->getViewDatas()] - ); + return $this->create_form_process_result(); } catch (\Exception $e) { return redirect()->back()->with('error', $e->getMessage()); } @@ -194,16 +198,20 @@ abstract class CommonController extends BaseController throw new \Exception("해당 정보를 찾을수 없습니다."); } } + protected function modify_form_process_result(): string + { + return view( + $this->view_path . "modify", + data: ['viewDatas' => $this->getViewDatas()] + ); + } final protected function modify_form_procedure(mixed $uid): RedirectResponse|string { try { helper(['form']); $this->modify_form_process($uid); $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; - return view( - $this->view_path . "modify", - data: ['viewDatas' => $this->getViewDatas()] - ); + return $this->modify_form_process_result(); } catch (\Exception $e) { return redirect()->back()->with('error', $e->getMessage()); }