Symfony does not take me well the ROUTE

2

I'm starting a project in symfony 4 and I have a problem with the routes. I am using annotations

This is my IndexController :

<?php

namespace App\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;


/**
 * Class IndexController
 *
 * @Route('/index')
 */
class IndexController extends AbstractController
{
    /**
     * @Route("/", name="index")
     */
    public function index()
    {
        return $this->render('index/index.html.twig', [
            'controller_name' => 'IndexController',
        ]);
    }
}

And this is the error that it gives me:

I have also installed annotations and routing with which it should work but it does not.

    
asked by Pavlo B. 19.10.2018 в 19:20
source

1 answer

0

Verify that you have this code in your routes.yaml in the config directory.

controller:
     resource: "../src/Controller"
     type: annotation
    
answered by 19.11.2018 в 19:59