Smarty PHP与AngularJS冲突

当我在同一模板中使用AngularJS时,如何停止Smarty抛出错误.我有一个Smarty页面模板与此代码
<li ng-repeat="i in items">
      <p class="item">{{i}}</p>
 </li>

当我在浏览器中查看时,我得到一个空白页.我的apache error_log中有一个很大的错误,其中包含以下内容

PHP Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template ... <p>{{i}}</p>; unkNown tag "i

如果我{{i}} {{4}}或任何其他数字互换,它可以正常运作.我也可以使用数学,{{8 2}}将在页面显示10. Smarty是否在做数学运算?

尝试这个:
<li ng-repeat="i in items">
    <p class="item">{literal}{{i}}{/literal}</p>
</li>

从Smarty网站报价…

{literal} tags allow a block of data to be taken literally. This is typically used around Javascript or stylesheet blocks where {curly braces} would interfere with the template delimiter Syntax. Anything within {literal}{/literal} tags is not interpreted,but displayed as-is.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...