42 lines
1.5 KiB
PHP
42 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers\Admin;
|
|
|
|
use App\Controllers\CommonController;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
use App\Services\Customer\ServiceService;
|
|
|
|
abstract class AdminController extends CommonController
|
|
{
|
|
private ?ServiceService $_serviceService = null;
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
parent::initController($request, $response, $logger);
|
|
$this->layout = "admin";
|
|
$this->uri_path = "admin/";
|
|
$this->view_path = "admin" . DIRECTORY_SEPARATOR;
|
|
$this->content_title = "관리자";
|
|
$this->helper = $this->getHelper();
|
|
}
|
|
//Service,ServicePaymentController사용
|
|
final public function getServiceService(): ServiceService
|
|
{
|
|
if (!$this->_serviceService) {
|
|
$this->_serviceService = new ServiceService();
|
|
}
|
|
return $this->_serviceService;
|
|
}
|
|
|
|
//LINE,IP,SERVER등 추가 FilterOption 셋팅용
|
|
final protected function setFilterOptionsByItemType(): void
|
|
{
|
|
//LINE,IP,SERVER등 추가 FilterOption 셋팅용
|
|
foreach (SERVICE_ITEM_TYPES as $item_type => $label) {
|
|
$this->setFieldRule($item_type, $this->getFormFieldRule($this->getAction(), $item_type));
|
|
$this->setFilterFieldOption($item_type, $this->getServiceService()->getFilterOptionsByItemType($item_type));
|
|
}
|
|
}
|
|
}
|