for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Finance module for HiPanel
*
* @link https://github.com/hiqdev/hipanel-module-finance
* @package hipanel-module-finance
* @license BSD-3-Clause
* @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
*/
namespace hipanel\modules\finance\widgets;
use Money\Money;
use Money\MoneyFormatter;
use yii\base\Widget;
class ResourcePriceWidget extends Widget
{
* @var Money
public $price;
* @var MoneyFormatter
private $moneyFormatter;
public function __construct(MoneyFormatter $moneyFormatter, $config = [])
parent::__construct($config);
$this->moneyFormatter = $moneyFormatter;
}
public function run()
return $this->moneyFormatter->format($this->price);