daemon-idc init
This commit is contained in:
parent
a38386bd78
commit
404a7e9be6
@ -5,7 +5,7 @@ use CodeIgniter\Router\RouteCollection;
|
|||||||
/**
|
/**
|
||||||
* @var RouteCollection $routes
|
* @var RouteCollection $routes
|
||||||
*/
|
*/
|
||||||
$routes->get('/', 'Home::index');
|
// $routes->get('/', 'Home::index');
|
||||||
|
|
||||||
|
|
||||||
//추가 Custom RULE 만들때 : ex)UUID형식
|
//추가 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->group('', ['namespace' => 'App\Controllers'], function ($routes) {
|
||||||
$routes->get('/', 'Home::index');
|
$routes->get('/', 'Welcome::index');
|
||||||
$routes->group('auth', ['namespace' => 'App\Controllers\Auth'], function ($routes) {
|
$routes->group('auth', ['namespace' => 'App\Controllers\Auth'], function ($routes) {
|
||||||
$routes->get('login', 'LocalController::login_form');
|
$routes->get('login', 'LocalController::login_form');
|
||||||
$routes->post('login', 'LocalController::login');
|
$routes->post('login', 'LocalController::login');
|
||||||
@ -27,7 +27,7 @@ $routes->group('', ['namespace' => 'App\Controllers'], function ($routes) {
|
|||||||
});
|
});
|
||||||
//Admin 관련
|
//Admin 관련
|
||||||
$routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'authFilter:manager'], function ($routes) {
|
$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->group('user', function ($routes) {
|
||||||
$routes->get('/', 'UserController::index');
|
$routes->get('/', 'UserController::index');
|
||||||
$routes->get('create', 'UserController::create_form');
|
$routes->get('create', 'UserController::create_form');
|
||||||
|
|||||||
@ -37,6 +37,7 @@ class Validation extends BaseConfig
|
|||||||
public array $templates = [
|
public array $templates = [
|
||||||
'list' => 'CodeIgniter\Validation\Views\list',
|
'list' => 'CodeIgniter\Validation\Views\list',
|
||||||
'single' => 'CodeIgniter\Validation\Views\single',
|
'single' => 'CodeIgniter\Validation\Views\single',
|
||||||
|
\App\Validation\CustomRules::class, // ✅ 추가
|
||||||
];
|
];
|
||||||
|
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|||||||
@ -7,7 +7,7 @@ use CodeIgniter\HTTP\RequestInterface;
|
|||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class Home extends AdminController
|
class Welcome extends AdminController
|
||||||
{
|
{
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
@ -2,36 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Controllers;
|
namespace App\Controllers;
|
||||||
|
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
class Home extends BaseController
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
|
|
||||||
class Home extends FrontController
|
|
||||||
{
|
{
|
||||||
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
|
public function index(): string
|
||||||
{
|
{
|
||||||
$action = __FUNCTION__;
|
return view('welcome_message');
|
||||||
$this->action_init_process($action);
|
|
||||||
return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate') ?? "welcome");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
37
app/Controllers/Welcome.php
Normal file
37
app/Controllers/Welcome.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
|
class Welcome extends FrontController
|
||||||
|
{
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user