dbmsv4/app/Controllers/Admin/AdminController.php
2025-11-25 11:52:10 +09:00

36 lines
1.7 KiB
PHP

<?php
namespace App\Controllers\Admin;
use App\Controllers\CommonController;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
abstract class AdminController extends CommonController
{
private $_layout = 'admin';
protected $layouts = [];
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->addActionPaths($this->_layout);
$this->layouts = LAYOUTS[$this->_layout];
}
protected function action_init_process(string $action, array $formDatas = [], ?object $entity = null): void
{
$this->service->action_init_process($action, $formDatas, $entity);
parent::action_init_process($action, $formDatas, $entity);
$this->addViewDatas('layout', $this->layouts);
$this->addViewDatas('title', $this->getTitle());
$this->addViewDatas('helper', $this->service->getHelper());
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields());
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules());
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters());
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions());
$this->addViewDatas('index_actionButtons', $this->service->getFormService()->getactionButtons());
$this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFilters());
$this->addViewDatas('index_batchjobButtons', $this->service->getFormService()->getBatchjobButtons());
}
}