38 lines
986 B
PHP
38 lines
986 B
PHP
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
use App\Controllers\BaseController;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
use App\Traits\AuthTrait;
|
|
|
|
abstract class CommonController extends BaseController
|
|
{
|
|
use AuthTrait;
|
|
private $_datas = [];
|
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
{
|
|
// Do Not Edit This Line
|
|
parent::initController($request, $response, $logger);
|
|
// Preload any models, libraries, etc, here.
|
|
// E.g.: $this->session = \Config\Services::session();
|
|
$this->session = $this->login_check();
|
|
}
|
|
|
|
final public function __get($name): array|null
|
|
{
|
|
if (!array_key_exists($name, $this->_datas)) {
|
|
return null;
|
|
}
|
|
return $this->_datas;
|
|
}
|
|
|
|
final public function __set($name, $value): void
|
|
{
|
|
$this->_datas[$name] = $value;
|
|
}
|
|
}
|