用于编写新行的PHP代码

时间:2015-05-20 17:38:28

标签: php text smarty line

$smarty->assign('buttonText', $this->l('CREDIT CARD | DEBIT CARD | NETBANKING  NO Extra Charges '));

我希望修改此代码,以便"没有额外费用"在一条新线上而不是在同一条线上

当前输出

CREDIT CARD | DEBIT CARD | NETBANKING  NO Extra Charges

预期输出

CREDIT CARD | DEBIT CARD | NETBANKING  
NO Extra Charges

这是用PHP编写的。整个代码是

public function hookPayment($params)
{
    if (!$this->active)
        return;

    global $smarty;

    $smarty->assign('buttonText', $this->l('CREDIT CARD | DEBIT CARD | NETBANKING  NO Extra Charges '));

    return $this->display(__FILE__, 'payment.tpl');
}

1 个答案:

答案 0 :(得分:1)

你能把断行<br>放入smarty变量吗?据我所知,Smarty应该有效。

$smarty->assign('buttonText', $this->l('CREDIT CARD | DEBIT CARD | NETBANKING<br>NO Extra Charges '));