Answer the question
In order to leave comments, you need to log in
Why can't the page be found?
Good afternoon everyone, I had such a problem, installed symfony 4, added an annotation package, and twig. I create a SiteController controller in it, I create a method for the main page, and when I try to render a file along the site/index.html.twig path, it cannot find this template for some reason.
Here is the controller
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Routing\Annotation\Route;
class SiteController extends Controller
{
/**
* @Route("/", name="index")
*/
public function index()
{
return $this->render('site/index.html.twig');
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question