<?php

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\HttpKernel\KernelInterface;
//use MyDevel\Webroot\Controller\WebrootMainController;

class MainController extends AbstractController //WebrootMainController
{
    #[Route('/', name: 'app_main')]
    public function index(KernelInterface $kernel): Response
    {
        $project_root = $kernel->getProjectDir();
        
        if (!file_exists(join(DIRECTORY_SEPARATOR,[$project_root,'.env.local']))) {
            return $this->redirect('/setup');
        }
        
        return $this->render('main/index.html.twig', [
            'controller_name' => $kernel->getProjectDir(),
        ]);
    }
}
