首页 > smarty分割符

smarty分割符

ecshop中smarty分割符{}和js函数中用的{}是怎么被区分的?


估计这个能回答,http://www.cnblogs.com/biluofeng/articles/2381276.html


{$smarty_var_name}

// in js script
function fun(){
    // do something
}

// in css script
body {
    color: red;
}

可以看到,如果想使用模板引擎解析,在{}中的变量之间不要包含空格,而如果不想被模板引擎解析,在{和}之间都有含有空格,或是换行等空格符。

当然,也可以使用 {literal} js script or css {/literal} 来防止被模板引擎解析。

【热门文章】
【热门文章】