Automation init...4
This commit is contained in:
parent
387c3bff27
commit
67e107d271
@ -15,7 +15,7 @@ $routes->get('/', 'Home::index');
|
|||||||
$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('/', 'Home::index');
|
||||||
$routes->group('user', function ($routes) {
|
$routes->group('user', function ($routes) {
|
||||||
$routes->get('', 'UserController::index');
|
$routes->get('/', 'UserController::index');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$routes->group('mangboard', ['namespace' => 'App\Controllers\Mangboard'], function ($routes) {
|
$routes->group('mangboard', ['namespace' => 'App\Controllers\Mangboard'], function ($routes) {
|
||||||
@ -35,10 +35,10 @@ $routes->group('mangboard', ['namespace' => 'App\Controllers\Mangboard'], functi
|
|||||||
$routes->group('cloudflare', ['namespace' => 'App\Controllers\Cloudflare'], function ($routes) {
|
$routes->group('cloudflare', ['namespace' => 'App\Controllers\Cloudflare'], function ($routes) {
|
||||||
$routes->group('account', function ($routes) {
|
$routes->group('account', function ($routes) {
|
||||||
$routes->get('/', 'AccountController::index');
|
$routes->get('/', 'AccountController::index');
|
||||||
$routes->get('/create', 'AccountController::create_form');
|
$routes->get('create', 'AccountController::create_form');
|
||||||
});
|
});
|
||||||
$routes->group('zone', function ($routes) {
|
$routes->group('zone', function ($routes) {
|
||||||
$routes->get('/', 'ZoneController::index');
|
$routes->get('/', 'ZoneController::index');
|
||||||
$routes->get('/create', 'ZoneController::create_form');
|
$routes->get('create', 'ZoneController::create_form');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class AccountController extends MVController
|
|||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->session = $this->session_AuthTrait();
|
$this->session = $this->session_AuthTrait();
|
||||||
$this->class_name = 'Account';
|
$this->class_name = 'Account';
|
||||||
$this->view_path = 'Account';
|
$this->view_path = 'cloudflare';
|
||||||
helper($this->class_name);
|
helper($this->class_name);
|
||||||
}
|
}
|
||||||
final protected function getModel(): AccountModel
|
final protected function getModel(): AccountModel
|
||||||
|
|||||||
@ -32,7 +32,7 @@ abstract class MVController extends CommonController
|
|||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
protected function getFormFieldInput(string $field, mixed $value, array $inputs = []): array
|
protected function getFormFieldInput(string $field, string $value, array $inputs = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'status':
|
case 'status':
|
||||||
@ -58,7 +58,7 @@ abstract class MVController extends CommonController
|
|||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "에서 field array 입니다.\n" . var_export($field, true));
|
throw new \Exception(__FUNCTION__ . "에서 field array 입니다.\n" . var_export($field, true));
|
||||||
}
|
}
|
||||||
$inputs = $this->getFormFieldInput($field, old($field), $inputs);
|
$inputs = $this->getFormFieldInput($field, old($field) ?? DEFAULTS['EMPTY'], $inputs);
|
||||||
}
|
}
|
||||||
return $inputs;
|
return $inputs;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,6 @@ use App\Models\CommonModel;
|
|||||||
|
|
||||||
class AccountModel extends CommonModel
|
class AccountModel extends CommonModel
|
||||||
{
|
{
|
||||||
|
|
||||||
const TABLE = "cloudflarerecord";
|
const TABLE = "cloudflarerecord";
|
||||||
const PK = "uid";
|
const PK = "uid";
|
||||||
const TITLE = "id";
|
const TITLE = "id";
|
||||||
@ -17,6 +16,10 @@ class AccountModel extends CommonModel
|
|||||||
protected $returnType = AccountEntity::class; //object,array,entity명::class
|
protected $returnType = AccountEntity::class; //object,array,entity명::class
|
||||||
protected $allowedFields = [self::PK, self::TITLE, 'apikey', 'oldkey', 'type', 'status', 'updated_at', 'created_at'];
|
protected $allowedFields = [self::PK, self::TITLE, 'apikey', 'oldkey', 'type', 'status', 'updated_at', 'created_at'];
|
||||||
protected $useTimestamps = true;
|
protected $useTimestamps = true;
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
public function getTitleField(): string
|
public function getTitleField(): string
|
||||||
{
|
{
|
||||||
return self::TITLE;
|
return self::TITLE;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user