连字符对于 Twig 中的块(例如 {% block body -%})是什么意思? [英] What does the hyphen mean for a block in Twig like in {% block body -%}?

查看:40
本文介绍了连字符对于 Twig 中的块(例如 {% block body -%})是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Symfony2 应用程序中使用 Doctrine 命令生成 CRUD 时,生成的 Twig 模板内容以这种方式定义在 Twig 块中:

When generating a CRUD in a Symfony2 application with Doctrine commands, generated Twig template content is defined within a Twig block this way:

{% block body -%}

{% endblock %}

-%} 中的连字符是什么意思?它在没有连字符的情况下工作正常,我在 Twig 文档中找不到任何类似的内容.

What does the hyphen in -%} mean? It works fine without the hyphen and I could not find anything similar in the Twig documentation.

推荐答案

-%} 表示修剪空格.

请参阅文档的空白控制部分.

这篇关于连字符对于 Twig 中的块(例如 {% block body -%})是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆