44 lines
1.4 KiB
PHP
44 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers\Admin\Device;
|
|
|
|
use App\Controllers\Admin\AdminController;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
use App\Services\Device\ServerService;
|
|
|
|
abstract class DeviceController extends AdminController
|
|
{
|
|
private $_serverService = null;
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
parent::initController($request, $response, $logger);
|
|
$this->uri_path .= 'device/';
|
|
// $this->view_path .= "device" . DIRECTORY_SEPARATOR;
|
|
}
|
|
final public function getServerService(): ServerService
|
|
{
|
|
if (!$this->_serverService) {
|
|
$this->_serverService = new ServerService($this->request);
|
|
}
|
|
return $this->_serverService;
|
|
}
|
|
//Index,FieldForm관련
|
|
protected function getFormFieldOption(string $field, array $options = []): array
|
|
{
|
|
switch ($field) {
|
|
case 'serverinfo_uid':
|
|
$options[$field] = $this->getServerService()->getFormFieldOption($field);
|
|
// echo $this->getUserModel()->getLastQuery();
|
|
// dd($options);
|
|
break;
|
|
default:
|
|
$options = parent::getFormFieldOption($field, $options);
|
|
break;
|
|
}
|
|
return $options;
|
|
}
|
|
//Index,FieldForm관련
|
|
}
|