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() {