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

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...