<?php
namespace App\Controllers;

use App\Core\Controller;
use App\Models\Conference;

class ConferenceController extends Controller
{
    public function index()
    {
        $model = new Conference();
        $conferences = $model->all();
        $this->view('conference/index', compact('conferences'));
    }

    public function show()
    {
        $id = $_GET['id'] ?? null;

        $model = new Conference();
        $conference = $model->find($id);

        if (!$conference) {
            http_response_code(403);
            echo "Conference not accessible";
            return;
        }

        $this->view('conference/show', compact('conference'));
    }
}
