douzhao4071 2013-12-11 21:34
浏览 45
已采纳

在块插件期间禁用PHP Smarty中的剥离

We're using Smarty to generate HTML from PHP. A number of plugins have been added to make life easier.

One of these plugins is a block plugin that interprets a custom language and generates HTML code. The custom language has simple statement, using linebreaks to separate the statements. Smarty's builtin {strip} plugin concatenates these statements onto a single line, making the language fail.

For instance, this is the input:

<div>
{table}
    column "Size" sortable editable number
    column "Color" sortable editable color
{/table}
</div>

If this is placed within a {strip}, the statements get concatenated and the language is no longer valid.

The simple solution is to place {/strip} and {strip} just outside the block plugin's open and close tags. However, this requires our template designers to remember this peculiarity (they don't).

Is there any way to disable {strip} for the content of a Smarty plugin?

  • 写回答

1条回答 默认 最新

  • dragonsun00000 2013-12-26 21:53
    关注

    I think the {literal} tag should escape stripping:

    <div>
    {table}{literal}
        column "Size" sortable editable number
        column "Color" sortable editable color
    {/literal}{/table}
    </div>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料