문제

How Do I format this code to display a Great British Pound Currency (£) sign but only next to the $item['total']?

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

I can't seem to get the syntax right.

This attempt did not work:

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

The documentation is here: http://api12.cakephp.org/class/number-helper#method-NumberHelpercurrency

도움이 되었습니까?

해결책

try this:

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

Hope this helps

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top