微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

php – YAML文件不能包含制表符为缩进

这是我第一次使用symfony 2.所有我想在这里做的是每当用户点击提交按钮,他将去另一个页面.

但是我的索引页没有加载.他们说我的路由文件有问题.我不知道我做错了什么这是我的路由文件.请帮帮我.

community_online_shop_homepage:
    pattern: /
    defaults: { _controller: CommunityOnlineshopBundle:Page:index }
_login:
    pattern: /login
    defaults: { _controller: CommunityOnlineshopBundle:Page:login}

请帮帮我.我被困了几个小时

YAML文件使用空格作为缩进,您可以使用2或4个空格进行缩进,但不使用选项卡.换句话说,禁止标签缩进:

Why does YAML forbid tabs?

Tabs have been outlawed since they are treated differently by different editors and tools. And since indentation is so critical to proper interpretation of YAML,this issue is just too tricky to even attempt. Indeed Guido van Rossum of Python has ackNowledged that allowing TABs in Python source is a headache for many people and that were he to design Python again,he would forbid them.

(来源:YAML FAQ(感谢Destiny Architect链接))

例如,Symfony configuration file可以写入2或4个空格作为缩进:

4个空格

doctrine:
    dbal:
        default_connection: default

2个空格

doctrine:
  dbal:
    default_connection: default

原文地址:https://www.jb51.cc/php/130985.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐