在symfony中将功能从一个控制器移动到另一个控制器

时间:2015-05-15 04:34:04

标签: symfony

我在DemoController中编写了一个函数。

/**
 * @Route("/test/")
 * @Template()
 */
public function testAction() {
    return somethng_response;
}

现在我想将它转移到AppBundle中的DefaultController。我只是将这些东西移到了那个控制器中,但我得到了以下错误

FileLoaderImportCircularReferenceException in FileLoader.php line 97: Circular reference detected in "D:\myProj\app/config/routing_dev.yml" ("D:\myProj\app/config/routing_dev.yml" > "D:\myProj\app/config\routing.yml" > "D:\myProj\src\AppBundle/Controller/" > "D:\myProj\app/config/routing_dev.yml").

routing_dev.yml

_wdt:
    resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
    prefix:   /_wdt

_profiler:
    resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
    prefix:   /_profiler

_configurator:
    resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml"
    prefix:   /_configurator

_errors:
    resource: "@TwigBundle/Resources/config/routing/errors.xml"
    prefix:   /_error

_main:
    resource: routing.yml

# AcmeDemoBundle routes (to be removed)
_acme_demo:
    resource: "@AcmeDemoBundle/Resources/config/routing.yml"

的routing.yml

app:
    resource: "@AppBundle/Controller/"
    type:     annotation

0 个答案:

没有答案