<?php
declare(strict_types=1);

namespace App\Core;

class Controller
{
    protected function view(string $name, array $data = []): void
    {
        extract($data);
        $path = __DIR__ . '/../Views/' . $name . '.php';
        if (file_exists($path)) {
            require $path;
        } else {
            echo $name;
        }
    }
}
