这是我的app/config/routing.yml
AppBundle:
resource: "@AppBundle/Controller/"
type: annotation
prefix: /
RapportBundle:
resource: "@RapportBundle/Controller/"
type: annotation
prefix: /rapport
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
RapportBundle /控制器/ RapportController.php
<?php
namespace RapportBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class RapportController extends Controller
{
/**
* @Template
* @Route("/", name="rapport_index")
*/
public function indexAction()
{
return [];
}
}
与AppBundle / Controller / DefaultController.php相同的文件
当我从DefaultController启动索引时,我得到了这个:
Circular reference detected in "/var/www/my-site/app/config/routing_dev.yml" ("/var/www/my-site/app/config/routing_dev.yml" > "/var/www/my-site/app/config/routing.yml" > "/var/www/my-site/app/config/routing_dev.yml").
(我的routing_dev.yml尚未更改,它是Symfony2基础)
你知道为什么吗?
答案 0 :(得分:1)
我自己回答:
我忘了将RapportBundle添加到AppKernel ....