<?php

namespace lib\Core;

require_once __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Configs' . DIRECTORY_SEPARATOR . 'Constant.php';

use lib\Configs\View;

abstract class Controller
{
    private $_request = null;
    private ?View $_view = null;
    protected function __construct()
    {
        $this->_view = new View();
    } //
    final public function getView(): View
    {
        return $this->_view;
    }
    final public function __get($name)
    {
        return $this->getView()->$name;
    }
    final public function __set($name, $value)
    {
        $this->getView()->$name = $value;
    }
    public function render(string $path)
    {
        return $this->getView()->render($path);
    }
} //Class
