2012-05-02 24 views
0

如何格式化此代码以显示一个伟大的英镑货币(£)符号,但只在$ item ['total']旁边?CakePHP 1.2 Number Helper - 货币方法格式为GDP£

<?php echo $id; ?>Total"><?php echo $number->currency (isset($item['total']) ? 
$item['total'] : $item['quantity'] * $item['price']); ?> 

我似乎无法得到正确的语法。

这种尝试没有成功:

<?php echo $id; ?>Total"><?php echo $number->currency (isset($item['total'], 'GDP') ? 
$item['total'] : $item['quantity'] * $item['price']); ?> 

的文档是在这里: http://api12.cakephp.org/class/number-helper#method-NumberHelpercurrency

+0

请帮助我! –

回答

0

试试这个:

<?php echo $number->currency ((isset($item['total']) ? $item['total'] : $item['quantity'] * $item['price']),'GBP'); ?> 

希望这有助于