From a73e9c178fe66e22e9248bb809586e8f49b7fda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0git=20config=20git=20config=20-?= =?UTF-8?q?-helpgit=20config=20--global=20user=2Ename=20=EC=B5=9C=EC=A4=80?= =?UTF-8?q?=ED=9D=A0?= Date: Mon, 7 Aug 2023 21:29:31 +0900 Subject: [PATCH] shoppingmallv2 init.. --- app/Controllers/Admin/BoardController.php | 4 ---- app/Controllers/Admin/UserController.php | 20 -------------------- app/Controllers/BaseController.php | 5 ++++- app/Controllers/Front/BoardController.php | 15 --------------- 4 files changed, 4 insertions(+), 40 deletions(-) diff --git a/app/Controllers/Admin/BoardController.php b/app/Controllers/Admin/BoardController.php index 961c629..aa6eaa2 100644 --- a/app/Controllers/Admin/BoardController.php +++ b/app/Controllers/Admin/BoardController.php @@ -46,10 +46,6 @@ class BoardController extends AdminController protected function getFieldFormData(string $field, $entity = null): array { switch ($field) { - case 'passwd': - $this->_viewDatas['fieldDatas'][$field] = $this->request->getVar($field); - $this->_viewDatas['fieldDatas']['confirmpassword'] = $this->request->getVar('confirmpassword'); - break; case 'board_file': $file = $this->upload_file_procedure($field); if (!is_null($file)) { diff --git a/app/Controllers/Admin/UserController.php b/app/Controllers/Admin/UserController.php index cd5d1aa..72bbd54 100644 --- a/app/Controllers/Admin/UserController.php +++ b/app/Controllers/Admin/UserController.php @@ -15,26 +15,6 @@ class UserController extends AdminController parent::initController($request, $response, $logger); $this->_viewPath .= strtolower($this->_model->getClassName()); } - - //Field별 Form Datas 처리용 - protected function getFieldFormData(string $field, $entity = null): array - { - switch ($field) { - case 'passwd': - $passwd = $this->request->getVar($field) ?: false; - $confirmpassword = $this->request->getVar('confirmpassword') ?: false; - if ($passwd && $confirmpassword) { - $this->_viewDatas['fieldDatas'][$field] = $passwd; - $this->_viewDatas['fieldDatas']['confirmpassword'] = $confirmpassword; - } - break; - default: - return parent::getFieldFormData($field, $entity); - break; - } - return $this->_viewDatas['fieldDatas']; - } - public function getFields(string $action = ""): array { $fields = ["id", "passwd", 'name', "email", "role", "status"]; diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index ad861d1..51e322d 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -87,7 +87,10 @@ abstract class BaseController extends Controller { switch ($field) { default: - $this->_viewDatas['fieldDatas'][$field] = $this->request->getVar($field); + $value = $this->request->getVar($field); + if (!is_null($value)) { + $this->_viewDatas['fieldDatas'][$field] = $value; + } break; } return $this->_viewDatas['fieldDatas']; diff --git a/app/Controllers/Front/BoardController.php b/app/Controllers/Front/BoardController.php index 066b292..63a5d76 100644 --- a/app/Controllers/Front/BoardController.php +++ b/app/Controllers/Front/BoardController.php @@ -39,21 +39,6 @@ class BoardController extends FrontController { return parent::getFieldBatchFilters(); } - //Field별 Form Datas 처리용 - protected function getFieldFormData(string $field, $entity = null): array - { - switch ($field) { - case 'passwd': - $this->_viewDatas['fieldDatas'][$field] = $this->request->getVar($field); - $this->_viewDatas['fieldDatas']['confirmpassword'] = $this->request->getVar('confirmpassword'); - break; - default: - return parent::getFieldFormData($field, $entity); - break; - } - return $this->_viewDatas['fieldDatas']; - } - //Insert관련 protected function insert_form_process() {