1

在 Symfony 3.3 中,我在

../app/Resources/TwigBundle/views/Exception/error404.html.twig

在该模板中,我扩展了一个基本模板,例如

{% extends 'base.html.twig' %}

我收到这个错误

The merge filter only works with arrays or "Traversable", got "NULL" as first argument.

我试过了

{% extends ':base.html.twig' %}

也,导致以下错误

Unable to find template ":base.html.twig" (looked into: ..\Path\to\App\app/Resources/views, ..)

请注意,路径是正确的,但 twig(?) 没有找到模板。

我找不到解决此问题的方法...非常感谢任何帮助。

4

1 回答 1

0

我被错误信息误导了。问题来自另一个包含的模板,该模板使用空变量并试图将其与其他内容合并。因此,实际问题与任何“扩展”调用无关。

于 2018-03-10T18:07:31.903 回答