cfmgrv4 init...1

This commit is contained in:
최준흠 2024-09-24 21:16:35 +09:00
parent 0672b0e1df
commit 99f88a6a92
5 changed files with 16 additions and 16 deletions

View File

@ -24,6 +24,8 @@ class Pager extends BaseConfig
'default_full' => 'CodeIgniter\Pager\Views\default_full',
'default_simple' => 'CodeIgniter\Pager\Views\default_simple',
'default_head' => 'CodeIgniter\Pager\Views\default_head',
'bootstrap_full' => 'Pagers\bootstrap_full',
'bootstrap_simple' => 'Pagers\bootstrap_simple',
];
/**

View File

@ -205,26 +205,26 @@ abstract class MVController extends CommonController
{
//조건절 처리
foreach ($this->filter_fields as $field) {
$this->$field = $this->request->getVar($field) ?? DEFAULTS['EMPTY'];
$this->$field = $this->request->getVar($field) ?: DEFAULTS['EMPTY'];
if ($this->$field !== DEFAULTS['EMPTY']) {
$this->getMyLibrary()->getMyStorage()->setList_FieldFilter($field, $this->$field);
}
}
//검색어 처리
$this->word = $this->request->getVar('word') ?? DEFAULTS['EMPTY'];
$this->word = $this->request->getVar('word') ?: DEFAULTS['EMPTY'];
if ($this->word !== DEFAULTS['EMPTY']) {
$this->getMyLibrary()->getMyStorage()->setList_WordFilter($this->word);
}
//검색일 처리
$this->start = $this->request->getVar('start') ?? DEFAULTS['EMPTY'];
$this->end = $this->request->getVar('end') ?? DEFAULTS['EMPTY'];
$this->start = $this->request->getVar('start') ?: DEFAULTS['EMPTY'];
$this->end = $this->request->getVar('end') ?: DEFAULTS['EMPTY'];
if ($this->start !== DEFAULTS['EMPTY'] && $this->end !== DEFAULTS['EMPTY']) {
$this->getMyLibrary()->getMyStorage()->setList_DateFilter($this->start, $this->end);
}
if (!$isTotalCount) {
//Sorting 처리
$this->order_field = $this->request->getVar('order_field') ?? DEFAULTS['EMPTY'];
$this->order_value = $this->request->getVar('order_value') ?? DEFAULTS['EMPTY'];
$this->order_field = $this->request->getVar('order_field') ?: DEFAULTS['EMPTY'];
$this->order_value = $this->request->getVar('order_value') ?: DEFAULTS['EMPTY'];
if ($this->order_field !== DEFAULTS['EMPTY'] && $this->order_value !== DEFAULTS['EMPTY']) {
$this->getMyLibrary()->getMyStorage()->setList_OrderBy("{$this->order_field} {$this->order_value}");
}
@ -237,11 +237,11 @@ abstract class MVController extends CommonController
return $this->getMyLibrary()->getMyStorage()->countAllResults();
}
//PageNation 처리
protected function list_pagination($pager_group = 'default', int $segment = 0, $template = 'bootstrap_full'): string
protected function list_pagination($pager_group = 'default', int $segment = 0, $template = 'default_full'): string
{
//Page, Per_page필요부분
$this->page = (int)$this->request->getVar('page') ?? 1;
$this->per_page = (int)$this->request->getVar('per_page') ?? $this->_per_page;
$this->page = (int)$this->request->getVar('page') ?: 1;
$this->per_page = (int)$this->request->getVar('per_page') ?: 20;
//줄수 처리용
$page_options = array("" => "줄수선택");
for ($i = 10; $i <= $this->total_count + $this->per_page; $i += 10) {
@ -272,7 +272,7 @@ abstract class MVController extends CommonController
protected function list_entitys(): array
{
$this->list_condition();
if (array_key_exists('page', $this->_viewDatas)) {
if ($this->page) {
$this->getMyLibrary()->getMyStorage()->limit(
$this->per_page,
$this->page * $this->per_page - $this->per_page

View File

@ -1,6 +1,6 @@
<?php
namespace App\Models\Cloudflare\API;
namespace App\Models\Cloudflare;
use CodeIgniter\Model;
use App\Entities\Cloudflare\ZoneEntity;
@ -31,8 +31,7 @@ class RecordModel extends Model
{
switch ($field) {
case self::PARENT:
$rules[$field] = "required|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]";
;
$rules[$field] = "required|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]";;
break;
case self::TITLE:
case "content":

View File

@ -3,7 +3,6 @@
namespace App\Models\Cloudflare;
use App\Models\CommonModel;
use App\Models\Cloudflare\API\RecordModel;
use App\Entities\Cloudflare\ZoneEntity;
use App\Entities\Cloudflare\AccountEntity;
@ -31,8 +30,7 @@ class ZoneModel extends CommonModel
{
switch ($field) {
case self::PARENT:
$rules[$field] = "required|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]";
;
$rules[$field] = "required|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]";;
break;
case self::TITLE:
case "plan":

View File

@ -1,4 +1,5 @@
<?php
/**
* bs_full.php - - Bootstrap 4.5.2 Pager Template.
* @var \CodeIgniter\Pager\PagerRenderer $pager