From 537f563f2b03473ed8ead2e8bcb6b339169893ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Mon, 21 Oct 2024 12:42:11 +0900 Subject: [PATCH] cfmgrv4 init...3 --- .../Admin/Cloudflare/FirewallController.php | 19 ------------ .../Admin/Cloudflare/RecordController.php | 27 ++++------------- .../Admin/Cloudflare/ZoneController.php | 29 ++++--------------- app/Controllers/MVController.php | 2 +- .../record/{view.php => create_result.php} | 0 .../zone/{view.php => create_result.php} | 0 6 files changed, 13 insertions(+), 64 deletions(-) rename app/Views/admin/cloudflare/record/{view.php => create_result.php} (100%) rename app/Views/admin/cloudflare/zone/{view.php => create_result.php} (100%) diff --git a/app/Controllers/Admin/Cloudflare/FirewallController.php b/app/Controllers/Admin/Cloudflare/FirewallController.php index 2bcd13d..34c2551 100644 --- a/app/Controllers/Admin/Cloudflare/FirewallController.php +++ b/app/Controllers/Admin/Cloudflare/FirewallController.php @@ -81,26 +81,7 @@ class FirewallController extends CloudflareController } //View //create_process_result에서 결과값을 entitys에 저장하고 호출하기때문에 아래와 같이 처리함 - protected function view_process(mixed $uid): void - { - //자신정보정의 - $entity = $this->getModel()->getEntityByPK($uid); - if ($entity === null) { - throw new \Exception("Zone {$uid} 정보를 찾을수 없습니다."); - } - $this->entitys = [$entity]; - // dd($this->entitys); - } //create_process_result에서 같이 사용한다는 점 주의 - protected function view_process_result(): string - { - helper(['form']); - $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; - return view( - strtolower($this->view_path . $this->class_path . "/view"), - data: ['viewDatas' => $this->getViewDatas()] - ); - } public function view(string $uid): RedirectResponse|string { $this->init(__FUNCTION__); diff --git a/app/Controllers/Admin/Cloudflare/RecordController.php b/app/Controllers/Admin/Cloudflare/RecordController.php index 8b13596..282188f 100644 --- a/app/Controllers/Admin/Cloudflare/RecordController.php +++ b/app/Controllers/Admin/Cloudflare/RecordController.php @@ -136,7 +136,12 @@ class RecordController extends CloudflareController protected function create_process_result(): RedirectResponse|string { $this->init(__FUNCTION__); - return $this->view_process_result(); + helper(['form']); + $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; + return view( + strtolower($this->view_path . $this->class_path . "/create_result"), + data: ['viewDatas' => $this->getViewDatas()] + ); } public function create(): RedirectResponse|string { @@ -176,26 +181,6 @@ class RecordController extends CloudflareController } //View //create_process_result에서 결과값을 entitys에 저장하고 호출하기때문에 아래와 같이 처리함 - protected function view_process(mixed $uid): void - { - //자신정보정의 - $entity = $this->getModel()->getEntityByPK($uid); - if ($entity === null) { - throw new \Exception("Zone {$uid} 정보를 찾을수 없습니다."); - } - $this->entitys = [$entity]; - // dd($this->entitys); - } - //create_process_result에서 같이 사용한다는 점 주의 - protected function view_process_result(): string - { - helper(['form']); - $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; - return view( - strtolower($this->view_path . $this->class_path . "/view"), - data: ['viewDatas' => $this->getViewDatas()] - ); - } public function view(string $uid): RedirectResponse|string { $this->init(__FUNCTION__); diff --git a/app/Controllers/Admin/Cloudflare/ZoneController.php b/app/Controllers/Admin/Cloudflare/ZoneController.php index 0dc44ed..2e75179 100644 --- a/app/Controllers/Admin/Cloudflare/ZoneController.php +++ b/app/Controllers/Admin/Cloudflare/ZoneController.php @@ -176,7 +176,12 @@ class ZoneController extends CloudflareController protected function create_process_result(): RedirectResponse|string { $this->init(__FUNCTION__); - return $this->view_process_result(); + helper(['form']); + $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; + return view( + strtolower($this->view_path . $this->class_path . "/create_result"), + data: ['viewDatas' => $this->getViewDatas()] + ); } public function create(): RedirectResponse|string { @@ -210,29 +215,7 @@ class ZoneController extends CloudflareController } //View //create_process_result에서 결과값을 entitys에 저장하고 호출하기때문에 아래와 같이 처리함 - protected function view_process(mixed $uid): void - { - //자신정보정의 - $entity = $this->getModel()->getEntityByPK($uid); - if ($entity === null) { - throw new \Exception("Zone {$uid} 정보를 찾을수 없습니다."); - } - //Zone에 대한 Record정의 - $this->getRecordModel()->where($this->getRecordModel()::PARENT, $entity->getPK()); - $entity->records = $this->getRecordModel()->getEntitys(); - $this->entitys = [$entity]; - // dd($this->entitys); - } //create_process_result에서 같이 사용한다는 점 주의 - protected function view_process_result(): string - { - helper(['form']); - $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; - return view( - strtolower($this->view_path . $this->class_path . "/view"), - data: ['viewDatas' => $this->getViewDatas()] - ); - } public function view(string $uid): RedirectResponse|string { $this->init(__FUNCTION__); diff --git a/app/Controllers/MVController.php b/app/Controllers/MVController.php index f7034a5..d9a4331 100644 --- a/app/Controllers/MVController.php +++ b/app/Controllers/MVController.php @@ -202,7 +202,7 @@ abstract class MVController extends CommonController } } //일괄처리작업 - final protected function batcjob_procedure(): RedirectResponse|string + final protected function batcjob_procedure(): RedirectResponse { //Transaction Start $this->getModel()->transStart(); diff --git a/app/Views/admin/cloudflare/record/view.php b/app/Views/admin/cloudflare/record/create_result.php similarity index 100% rename from app/Views/admin/cloudflare/record/view.php rename to app/Views/admin/cloudflare/record/create_result.php diff --git a/app/Views/admin/cloudflare/zone/view.php b/app/Views/admin/cloudflare/zone/create_result.php similarity index 100% rename from app/Views/admin/cloudflare/zone/view.php rename to app/Views/admin/cloudflare/zone/create_result.php