From 404a7e9be6fa6d16b45952e980c45d84da90ac8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Tue, 10 Feb 2026 15:00:55 +0900 Subject: [PATCH] daemon-idc init --- app/Config/Routes.php | 6 +-- app/Config/Validation.php | 1 + .../Admin/{Home.php => Welcome.php} | 2 +- app/Controllers/Home.php | 30 +-------------- app/Controllers/Welcome.php | 37 +++++++++++++++++++ 5 files changed, 44 insertions(+), 32 deletions(-) rename app/Controllers/Admin/{Home.php => Welcome.php} (98%) create mode 100644 app/Controllers/Welcome.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index dbe0f05..ed3e4c8 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -5,7 +5,7 @@ use CodeIgniter\Router\RouteCollection; /** * @var RouteCollection $routes */ -$routes->get('/', 'Home::index'); +// $routes->get('/', 'Home::index'); //추가 Custom RULE 만들때 : ex)UUID형식 @@ -17,7 +17,7 @@ $routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes) }); $routes->group('', ['namespace' => 'App\Controllers'], function ($routes) { - $routes->get('/', 'Home::index'); + $routes->get('/', 'Welcome::index'); $routes->group('auth', ['namespace' => 'App\Controllers\Auth'], function ($routes) { $routes->get('login', 'LocalController::login_form'); $routes->post('login', 'LocalController::login'); @@ -27,7 +27,7 @@ $routes->group('', ['namespace' => 'App\Controllers'], function ($routes) { }); //Admin 관련 $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'authFilter:manager'], function ($routes) { - $routes->get('/', 'Home::index'); + $routes->get('/', 'Welcome::index'); $routes->group('user', function ($routes) { $routes->get('/', 'UserController::index'); $routes->get('create', 'UserController::create_form'); diff --git a/app/Config/Validation.php b/app/Config/Validation.php index 7aa11a3..b6302bc 100644 --- a/app/Config/Validation.php +++ b/app/Config/Validation.php @@ -37,6 +37,7 @@ class Validation extends BaseConfig public array $templates = [ 'list' => 'CodeIgniter\Validation\Views\list', 'single' => 'CodeIgniter\Validation\Views\single', + \App\Validation\CustomRules::class, // ✅ 추가 ]; // -------------------------------------------------------------------- diff --git a/app/Controllers/Admin/Home.php b/app/Controllers/Admin/Welcome.php similarity index 98% rename from app/Controllers/Admin/Home.php rename to app/Controllers/Admin/Welcome.php index 49461e7..25bfd36 100644 --- a/app/Controllers/Admin/Home.php +++ b/app/Controllers/Admin/Welcome.php @@ -7,7 +7,7 @@ use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; use Psr\Log\LoggerInterface; -class Home extends AdminController +class Welcome extends AdminController { public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) { diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index ce81f32..5934333 100644 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -2,36 +2,10 @@ namespace App\Controllers; -use CodeIgniter\HTTP\RequestInterface; -use CodeIgniter\HTTP\ResponseInterface; -use Psr\Log\LoggerInterface; - -class Home extends FrontController +class Home extends BaseController { - public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) - { - parent::initController($request, $response, $logger); - if ($this->service === null) { - $this->service = service('userservice'); - } - } - protected function action_init_process(string $action, array $formDatas = []): void - { - parent::action_init_process($action, $formDatas); - $this->addViewDatas('layout', $this->layouts); - $this->addViewDatas('helper', $this->service->getHelper()); - $this->service->getActionForm()->action_init_process($action, $formDatas); - $this->addViewDatas('formFields', $this->service->getActionForm()->getFormFields()); - $this->addViewDatas('formRules', $this->service->getActionForm()->getFormRules()); - $this->addViewDatas('formFilters', $this->service->getActionForm()->getFormFilters()); - $this->addViewDatas('formOptions', $this->service->getActionForm()->getFormOptions()); - } - - //Index,FieldForm관련 public function index(): string { - $action = __FUNCTION__; - $this->action_init_process($action); - return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate') ?? "welcome"); + return view('welcome_message'); } } diff --git a/app/Controllers/Welcome.php b/app/Controllers/Welcome.php new file mode 100644 index 0000000..f2214a7 --- /dev/null +++ b/app/Controllers/Welcome.php @@ -0,0 +1,37 @@ +service === null) { + $this->service = service('userservice'); + } + } + protected function action_init_process(string $action, array $formDatas = []): void + { + parent::action_init_process($action, $formDatas); + $this->addViewDatas('layout', $this->layouts); + $this->addViewDatas('helper', $this->service->getHelper()); + $this->service->getActionForm()->action_init_process($action, $formDatas); + $this->addViewDatas('formFields', $this->service->getActionForm()->getFormFields()); + $this->addViewDatas('formRules', $this->service->getActionForm()->getFormRules()); + $this->addViewDatas('formFilters', $this->service->getActionForm()->getFormFilters()); + $this->addViewDatas('formOptions', $this->service->getActionForm()->getFormOptions()); + } + + //Index,FieldForm관련 + public function index(): string + { + $action = __FUNCTION__; + $this->action_init_process($action); + return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate') ?? "welcome"); + } +}