Twig

{{ dump() }}
{{ dump(variable_name) }}

List available variables (at top level):
{{ dump(_context|keys) }}

手风琴式的显示变量
{{ devel_dump() }}

避免大量的PHP代码逻辑
https://www.drupal.org/docs/theming-drupal/twig-in-drupal/debugging-twig-templates

----------------------

https://www.qed42.com/blog/art-of-writing-template-files-drupal-8
--

Tweak data -> Use Preprocess level alter
Tweak Markup -> Use Twig level customizations

涉及到大量数据,preprocess
markup,建议用template

------
可以考虑尽量用twig的函数。简单方便。

===========================================

这个template是在seven下实现的,
具体就是addPage方法生成x['content']

========================================

 https://twig.symfony.com/doc/2.x/tags/block.html

twig 下的 block 概念说明

https://www.zoocha.com/news/extending-twig-templates-blocks-drupal-8

这个文章很好的解释, 先把链接放这, 以后研究...

=========================================




原文地址:https://www.cnblogs.com/qinqiu/p/13529742.html