简体   繁体   中英

Pass smarty variable into {php}

I need a fragment of code which will transfer a smarty object into a php variable.

<h1>{$box.heading}</h1>

I need to get the {$box.heading} value. Something like

{php}
$header = {$box.heading}
{/php}

Is that even possible? btw. it is a .tpl file

你可以用assign来做

{assign var=heading value=$box['heading']}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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