<?php

namespace App\Controllers;

use CodeIgniter\Controller;
use CodeIgniter\HTTP\CLIRequest;
use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;

abstract class BaseController extends Controller
{
    protected $request;
    protected $helpers = ['url', 'form', 'text', 'number'];
    protected array $data = [];

    public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger): void
    {
        parent::initController($request, $response, $logger);

        $this->data = [
            'appName' => 'Undangan Khitanan Premium',
            'instansi' => 'Tasyakuran Khitanan',
            'developer' => 'Firdan Maulana Mukhtar',
            'user' => session()->get('admin_id') ? [
                'id' => session()->get('admin_id'),
                'name' => session()->get('admin_name'),
                'email' => session()->get('admin_email'),
            ] : null,
        ];
    }
}
