开发者

PHP Twig: access current template variable from within macro without passing?

Is it possible to access the cu开发者_Python百科rrent template's variables from within a macro without passing the variable to the macro directly? Thanks.


It's possible to pass all context variables to a macro:

{{ macro(_context) }}

_context is a special variable, which contains all currently defined variables (by name => value).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜