Home > Backend Development > PHP Tutorial > symFony2,手动配置的bundle报Unable to parse错误

symFony2,手动配置的bundle报Unable to parse错误

WBOY
Release: 2016-06-06 20:45:16
Original
1321 people have browsed it

错误信息如下
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空格

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template