当前位置:Gxlcms > PHP教程 > symFony2,手动配置的bundle报Unabletoparse错误

symFony2,手动配置的bundle报Unabletoparse错误

时间:2021-07-01 10:21:17 帮助过:6人阅读

错误信息如下
ParseException: Unable to parse at line 2 (near "resource:"@TestBundle/Resources/Config/routing.yml"").

文件内容是
Test:
resource:"@TestBundle/Resources/Config/routing.yml"
prefix: /

是@TestBundle不识别还是什么问题?有谁知道吗 谢

demo/test/Resources/Config/routing.yml的内容是

Test_homepage:
path: /Test/Test/demo
defaults: { _controller: TestBundle:TestController:index}

错误是 无法解析...//Symfony2.4.3/app/config/routing_dev.yml

回复内容:

错误信息如下
ParseException: Unable to parse at line 2 (near "resource:"@TestBundle/Resources/Config/routing.yml"").

文件内容是
Test:
resource:"@TestBundle/Resources/Config/routing.yml"
prefix: /

是@TestBundle不识别还是什么问题?有谁知道吗 谢

demo/test/Resources/Config/routing.yml的内容是

Test_homepage:
path: /Test/Test/demo
defaults: { _controller: TestBundle:TestController:index}

错误是 无法解析...//Symfony2.4.3/app/config/routing_dev.yml

你在写routing.yml文件的时候,
Test:
(这里)resource:"@TestBundle/Resources/Config/routing.yml"
(这里)prefix: /
是用tab开头空格还是用空格键空格? routing.yml不支持开头tab空格

人气教程排行