简体   繁体   中英

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 :

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.

See Template::Manual::Config for good examples of the effects with and without pre and post chomping.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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