我有以下代码和输出。
如果我 print_r,foreach 的正常 echo {},我得到数字 1?
我做错了什么?!
控制器:
if( $checkOrderNumber == '' || $checkOrderNumber == NULL ){
$var = '<a class="tool-link" href="url.php?dispatch=orders.details&order_id='. $_REQUEST['order_id'] .'&sendsurvey=yes">Send FBC invitation</a>';
}else{
$var = '<a href="#">FBC has been sent</a>';
}
Registry::get('view')->assign('var', $var);
聪明的TPL:
{assign var="var" value=$var}
<li>{$var}</li>
或者
{foreach from=$feedbackcompany item=foo}
<li>{$foo}</li>
{/foreach}
输出:
<li><a class="tool-link" href="admin.php?dispatch=orders.details&order_id=238205&sendsurvey=yes">Send FBC invitation</a>1</li>