NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
# `sandbox` The `sandbox` tag can be used to enable the sandboxing mode for an includedtemplate, when sandboxing is not enabled globally for the Twig environment: <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1 2 3</pre></div></td><td class="code"><div class="highlight"><pre>{% sandbox %} {% include 'user.html' %} {% endsandbox %} </pre></div></td></tr></table> Warning The `sandbox` tag is only available when the sandbox extension isenabled (see the [*Twig for Developers*](#) chapter). Note The `sandbox` tag can only be used to sandbox an include tag and itcannot be used to sandbox a section of a template. The following examplewon't work: <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1 2 3 4 5</pre></div></td><td class="code"><div class="highlight"><pre>{% sandbox %} {% for i in 1..2 %} {{ i }} {% endfor %} {% endsandbox %} </pre></div></td></tr></table>