简体   繁体   English

如何清除smarty模板文件中的致命错误?

[英]How to clear fatal error in smarty template file?

I am working in smarty variable $r = 1; 我正在使用聪明的变量$r = 1; $c = 2;

{$name['1-$r-$c']}

but it shows an fatal error. 但却显示出致命错误。 How to resolve this issue? 如何解决这个问题?

Smarty Templates doesn't calculate the vars within single quotes. Smarty模板不会计算单引号内的变量。 If you use double quotes like so: 如果您使用双引号这样:

{$name["1-$r-$c"]}

Your calculation should work. 您的计算应该会起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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