-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
I was struggling to debug why I got a circular reference error trying to add my controller to a new application. The controller below with the config in routing.yml should be able to reproduce this. I found out that the error is triggered by a missing use statement: use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
as I used @Template()
. I get the same error if the @Route
use statement is missing.
This error is very unclear and should be able to get a better message.
FileLoaderImportCircularReferenceException in FileLoader.php line 97:
Circular reference detected in "/home/ivanderberg/projects/login/www/app/config/routing.yml" ("/home/ivanderberg/projects/login/www/app/config/routing.yml" > "/home/ivanderberg/projects/login/www/src/App/Controller" > "/home/ivanderberg/projects/login/www/app/config/routing.yml").
// routing.yml
app:
resource: "@App/Controller"
type: annotation
prefix: /
<?php
namespace App\Controller\Auth;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
/**
* @Route(service="app.controller.auth.login")
*/
class LoginController
{
/**
* @Route("/", name="app.auth.login")
* @Template()
*/
public function loginAction()
{
return [];
}
}
Metadata
Metadata
Assignees
Labels
No labels