<?php

declare(strict_types=1);

namespace System\View;

final class View
{
    public function render(string $view, array $data = []): void
    {
        extract($data);

$file = APP_PATH
    . '/Modules/Administration/Views/'
    . str_replace('.', '/', $view)
    . '.php';

        if (!file_exists($file)) {
            throw new \RuntimeException("View not found: {$file}");
        }

        include $file;
    }
}