Symfony3.4 Deprecations: User Deprecated: Calling ... on template ..." from template .. 已弃用
Symfony3.4 Deprecations: User Deprecated: Calling ... on template ..." from template .. is deprecated
我在 Symfony 3.4 中收到以下已弃用的消息。
我调查了这个错误,但解决方案是包括 {% import "..." as macros %}
.
不过我已经装进去了,不知道怎么解决
有什么解决办法吗?
留言
User Deprecated: Calling "articleSearch" on template "AppAhiSpAdminBundle::adminmacros.html.twig" from template
"AppAhiSpAdminBundle:Hq/Article:index.html.twig" is deprecated since version 1.28
and won't be supported anymore in 2.0.
index.html.twig
{% extends 'AppAhiSpAdminBundle::hq_layout.html.twig' %}
<div class="search">
{{ macros.articleSearch(searchForm) }}
</div>
hq_layout.html.twig
{% extends '::base.html.twig' %}
{% import "AppAhiSpAdminBundle::adminmacros.html.twig" as macros %}
adminmacros.html.twig
{% macro articleSearch(searchForm) %}
{% endmacro %}
您需要在要使用宏的每个单独模板中导入宏
我在 Symfony 3.4 中收到以下已弃用的消息。
我调查了这个错误,但解决方案是包括 {% import "..." as macros %}
.
不过我已经装进去了,不知道怎么解决
有什么解决办法吗?
留言
User Deprecated: Calling "articleSearch" on template "AppAhiSpAdminBundle::adminmacros.html.twig" from template
"AppAhiSpAdminBundle:Hq/Article:index.html.twig" is deprecated since version 1.28
and won't be supported anymore in 2.0.
index.html.twig
{% extends 'AppAhiSpAdminBundle::hq_layout.html.twig' %}
<div class="search">
{{ macros.articleSearch(searchForm) }}
</div>
hq_layout.html.twig
{% extends '::base.html.twig' %}
{% import "AppAhiSpAdminBundle::adminmacros.html.twig" as macros %}
adminmacros.html.twig
{% macro articleSearch(searchForm) %}
{% endmacro %}
您需要在要使用宏的每个单独模板中导入宏