<?php declare(strict_types=1);

$type = isset($_GET['type']) ? preg_replace('/[^a-z_]/', '', $_GET['type']) : 'home';
$slug = isset($_GET['slug']) ? preg_replace('/[^a-z0-9-]/', '', $_GET['slug']) : '';

switch ($type) {
    case 'about':         require __DIR__ . '/templates/about.php'; break;
    case 'practice':      require __DIR__ . '/templates/practice.php'; break;
    case 'services_index':require __DIR__ . '/templates/services-index.php'; break;
    case 'service':       require __DIR__ . '/templates/service.php'; break;
    case 'testimonials':  require __DIR__ . '/templates/testimonials.php'; break;
    case 'contact':       require __DIR__ . '/templates/contact.php'; break;
    case 'gallery':        require __DIR__ . '/templates/gallery.php'; break;
    case 'events':        require __DIR__ . '/templates/events.php'; break;
    case 'event_detail':  require __DIR__ . '/templates/event-detail.php'; break;
    case 'legal':         require __DIR__ . '/templates/legal.php'; break;
    default:              require __DIR__ . '/templates/home.php'; break;
}
