简体   繁体   English

Template Toolkit中[%]和[% - - %]之间有什么区别?

[英]What is the difference between [% %] and [%- -%] in Template Toolkit?

Template Toolkit中[% %][%- -%]之间有什么区别?

The - automatically removes some whitespace from before/after the directive tag. -自动从指令标记之前/之后删除一些空格。

See Template::Manual::Syntax : 请参见Template :: Manual :: Syntax

You can add - or + to the immediate start or end of a directive tag to control the whitespace chomping options. 您可以在-指令标记的直接开头或结尾添加-+来控制空白选择。 See the PRE_CHOMP and POST_CHOMP options for further details. 有关更多详细信息,请参阅PRE_CHOMPPOST_CHOMP选项。

See Template::Manual::Config for good examples of the effects with and without pre and post chomping. 有关使用和不使用前后咀嚼效果的效果的良好示例,请参见Template :: Manual :: Config

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM