cfmgrv4 init...4

This commit is contained in:
최준흠 2024-10-08 19:33:44 +09:00
parent 9320123492
commit 14ab73fdc0
5 changed files with 21 additions and 24 deletions

View File

@ -88,7 +88,9 @@ abstract class MVController extends CommonController
));
}
}
protected function create_form_process(): void {}
protected function create_form_process(): void
{
}
final protected function create_form_procedure(): RedirectResponse|string
{
try {
@ -97,7 +99,7 @@ abstract class MVController extends CommonController
$this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
return view(
$this->view_path . "create",
$this->view_path . "create",
data: ['viewDatas' => $this->getViewDatas()]
);
} catch (\Exception $e) {
@ -348,7 +350,7 @@ abstract class MVController extends CommonController
$this->order_value = $this->request->getVar('order_value') ?: DEFAULTS['EMPTY'];
$this->getModel()->setList_OrderBy(
$this->order_field !== DEFAULTS['EMPTY'] &&
$this->order_value !== DEFAULTS['EMPTY'] ? "{$this->order_field} {$this->order_value}" : ""
$this->order_value !== DEFAULTS['EMPTY'] ? "{$this->order_field} {$this->order_value}" : ""
);
if ($this->page) {
$this->getModel()->limit(

View File

@ -1,13 +0,0 @@
<?php
namespace App\Helpers\Cloudflare;
use App\Helpers\CommonHelper;
class CloudflareHelper extends CommonHelper
{
public function __construct()
{
parent::__construct();
}
}

View File

@ -27,7 +27,7 @@ class RecordHelper extends CommonHelper
$form = form_input($field, $value, [
"placeholder" => "예)www.example.com",
"style" =>
"width:200px; ::placeholder{color:silver; opacity: 1;}",
"width:200px; ::placeholder{color:silver; opacity: 1;}",
...$extras
]);
break;
@ -41,7 +41,7 @@ class RecordHelper extends CommonHelper
$form = form_input($field, $value, [
"placeholder" => "예)123.123.123.123",
"style" =>
"width:200px; ::placeholder{color:silver; opacity: 1;}",
"width:200px; ::placeholder{color:silver; opacity: 1;}",
...$extras
]);
break;
@ -114,12 +114,14 @@ class RecordHelper extends CommonHelper
switch ($action) {
case 'modify':
$pk = $viewDatas['entity']->getPK();
$oldBatchJobUids = old("batchjob_uids", []);
$oldBatchJobUids = is_array($oldBatchJobUids) ? $oldBatchJobUids : [$oldBatchJobUids];
$checkbox = form_checkbox([
"id" => "checkbox_uid_{$pk}",
"name" => "batchjob_uids[]",
"value" => $pk,
"class" => "batchjobuids_checkboxs",
"checked" => in_array($pk, old("batchjob_uids[]", []))
"checked" => in_array($pk, $oldBatchJobUids)
]);
$extras = ["target" => "_self", ...$extras];
$action = $checkbox . anchor(

View File

@ -27,7 +27,7 @@ class ZoneHelper extends CommonHelper
$form = form_input($field, $value, [
"placeholder" => "예)exmaple.com",
"style" =>
"width:100%; ::placeholder{color:silver; opacity: 1;}",
"width:100%; ::placeholder{color:silver; opacity: 1;}",
...$extras
]);
break;
@ -44,7 +44,7 @@ class ZoneHelper extends CommonHelper
$form = form_input($field, $value, [
"placeholder" => "예)123.123.123.123",
"style" =>
"width:200px; ::placeholder{color:silver; opacity: 1;}",
"width:200px; ::placeholder{color:silver; opacity: 1;}",
...$extras
]);
break;
@ -138,12 +138,14 @@ class ZoneHelper extends CommonHelper
switch ($action) {
case 'modify':
$pk = $viewDatas['entity']->getPK();
$oldBatchJobUids = old("batchjob_uids", []);
$oldBatchJobUids = is_array($oldBatchJobUids) ? $oldBatchJobUids : [$oldBatchJobUids];
$checkbox = form_checkbox([
"id" => "checkbox_uid_{$pk}",
"name" => "batchjob_uids[]",
"value" => $pk,
"class" => "batchjobuids_checkboxs",
"checked" => in_array($pk, old("batchjob_uids[]", []))
"checked" => in_array($pk, $oldBatchJobUids)
]);
$extras = ["target" => "_self", ...$extras];
$action = $checkbox . anchor(

View File

@ -4,7 +4,9 @@ namespace App\Helpers;
abstract class CommonHelper
{
protected function __construct() {}
protected function __construct()
{
}
final public function getRandomString($length = 10, $characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
{
return substr(str_shuffle($characters), 0, $length);
@ -231,12 +233,14 @@ abstract class CommonHelper
break;
case 'modify':
$pk = $viewDatas['entity']->getPK();
$oldBatchJobUids = old("batchjob_uids", []);
$oldBatchJobUids = is_array($oldBatchJobUids) ? $oldBatchJobUids : [$oldBatchJobUids];
$checkbox = form_checkbox([
"id" => "checkbox_uid_{$pk}",
"name" => "batchjob_uids[]",
"value" => $pk,
"class" => "batchjobuids_checkboxs",
"checked" => in_array($pk, old("batchjob_uids[]", []))
"checked" => in_array($pk, $oldBatchJobUids)
]);
$action = $checkbox . form_label(
$viewDatas['cnt'],