<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class MY_Controller extends CI_Controller
{
    protected $layout = 'layouts/main';

    protected function render(string $view, array $data = []): void
    {
        $content = $this->load->view($view, $data, TRUE);
        $data['content_for_layout'] = $content;
        $this->load->view($this->layout, $data);
    }

    protected function render_plain(string $view, array $data = []): void
    {
        $this->load->view($view, $data);
    }
}
