Symfony尝试在文件开头解析注释时会引发解析异常。为了获得更多解释,我在下面放了一个示例代码:
#This is a comment
m:
subtitles:
movie: 'Movie subtitle'
整个异常是:"ParseException: Unable to parse in "<Directory path>...\\translations\\messages.es.yml" at line 1 (near "#This is a comment").
当我删除第一行(整个注释)时,它将起作用。我还尝试在#
字符和注释标题之间添加一个空格:
# This is a comment