<?php

class Controller
{
    protected function view(string $view, array $data = []): void
    {
        extract($data);

        require __DIR__ . '/../../resources/layouts/header.php';
        require __DIR__ . "/../../resources/{$view}.php";
        require __DIR__ . '/../../resources/layouts/footer.php';
    }

    protected function redirect(string $path): void
    {
        header("Location: {$path}");
        exit;
    }
}
