Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 php Smarty 我如何打印变量名而不是值?
例如。我想在屏幕上显示此文本“{firstname}”而不是 $firstname 变量值。
你的意思是你想包含字符{而不}将它们解释为Smarty synax?如果是{ldelim}{rdelim}这样,请检查and "functions"和{literal} ... {/literal}block function。
{
}
{ldelim}
{rdelim}
{literal} ... {/literal}
只需将firstname模板文件放入您希望它显示“名字”的位置。
firstname