This is my first work with Symfony 2. All I am trying to do here is whenever the user clicks on the submit button he will go to another page.
But my index page isn't loading. They are saying there is something wrong with my routing file, specifically:
A YAML file cannot contain tabs as indentation
I don't know what I have done wrong. Here is my routing file.
community_online_shop_homepage: pattern: / defaults: { _controller: CommunityOnlineShopBundle:Page:index } _login: pattern: /login defaults: { _controller: CommunityOnlineShopBundle:Page:login}
A YAML file use spaces as indentation, you can use 2 or 4 spaces for indentation, but no tab. In other words, tab indentation is forbidden: Why does YAML forbid tabs? Tabs have been outlawed since they are treated differently by different editors and tools.
Tabs ARE allowed in YAML, but only where indentation does not apply. According to YAML 1.2 Section 5.5: YAML recognizes two white space characters: space and tab.
In YAML block styles, structure is determined by indentation. In general, indentation is defined as a zero or more space characters at the start of a line. To maintain portability, tab characters must not be used in indentation, since different systems treat tabs differently.
Go to Settings >> Preferences and choose Tab Settings. Scroll down in the “Tab Settings” list to “yaml”. Uncheck the “use default value” and choose “replace by space”.
A YAML file use spaces as indentation, you can use 2 or 4 spaces for indentation, but no tab. In other words, tab indentation is forbidden:
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.
(source: YAML FAQ (thanks to Destiny Architect for the link))
For example, the Symfony configuration file can be written with 2 or 4 spaces as indentation:
doctrine: dbal: default_connection: default
doctrine: dbal: default_connection: default
[*.yml] indent_style = space indent_size = 4
you can change indent_size to 2, depends on your preferences
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With