本文整理汇总了PHP中app\models\Currency::format方法的典型用法代码示例。如果您正苦于以下问题:PHP Currency::format方法的具体用法?PHP Currency::format怎么用?PHP Currency::format使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Currency
的用法示例。
在下文中一共展示了Currency::format方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
</div>
<?php
ActiveForm::end();
?>
</div>
<div class="receipt-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
$columns = [['attribute' => 'bukmark_code', 'label' => 'Código', 'value' => 'product.bukmark_code', 'options' => ['style' => 'width: 100px;']], ['attribute' => 'product_id', 'value' => 'product.title', 'filter' => Html::activeDropDownList($searchModel, 'product_id', Product::getDropdownData(), ['class' => 'form-control', 'prompt' => 'Elegir producto']), 'enableSorting' => false], ['label' => 'Cliente', 'value' => 'estimate.client.name', 'filter' => Html::activeDropDownList($searchModel, 'client_id', Client::getIdNameArray(), ['class' => 'form-control', 'prompt' => 'Nombre'])], ['attribute' => 'estimate.receipt.created_date', 'format' => 'date', 'filter' => false], ['attribute' => 'quantity'], ['label' => 'Total', 'value' => function ($model, $key, $index, $column) {
return Currency::format($model->quantitySubtotal, Currency::CURRENCY_ARS);
}, 'options' => ['style' => 'width: 150px;']]];
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $columns]);
?>
<?php
echo ExportMenu::widget(['dataProvider' => $exportDataProvider, 'target' => ExportMenu::TARGET_SELF, 'showConfirmAlert' => false, 'filename' => 'resumen', 'columns' => $columns]);
?>
</div>
示例2: function
}], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'variant_price', 'value' => function ($model, $key, $index, $column) {
return Currency::format($model->variant_price, $model->variant_currency);
}, 'editableOptions' => function ($model, $key, $index) {
return ['formOptions' => ['enableClientValidation' => false], 'inputFieldConfig' => ['inputOptions' => ['value' => Yii::$app->formatter->asDecimal($model->variant_price, 2)]]];
}, 'refreshGrid' => true, 'filter' => false], ['label' => 'Suma', 'value' => function ($model, $key, $index, $column) {
return Currency::format($model->cost, Currency::CURRENCY_ARS);
}], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'utility', 'value' => $percentageDisplayFunction, 'editableOptions' => function ($model, $key, $index) use($percentageDisplayFunction) {
return ['formOptions' => ['enableClientValidation' => false], 'inputFieldConfig' => ['inputOptions' => ['value' => call_user_func($percentageDisplayFunction, $model, $key, $index, 'utility')]]];
}, 'refreshGrid' => true, 'filter' => false], ['label' => 'Subtotal', 'value' => function ($model, $key, $index, $column) {
return Currency::format($model->subtotal, Currency::CURRENCY_ARS);
}], ['label' => 'Subt. x cant.', 'value' => function ($model, $key, $index, $column) {
return Currency::format($model->quantitySubtotal, Currency::CURRENCY_ARS);
}]];
if ($user->admin) {
$marginColumn = ['label' => 'Margen', 'value' => function ($model, $key, $index, $column) {
return Currency::format($model->utilityMargin, Currency::CURRENCY_ARS);
}];
array_push($columns, $marginColumn);
}
$sampleColumn = ['class' => 'yii\\grid\\ActionColumn', 'header' => 'Muestra', 'options' => ['style' => 'width: 70px;'], 'template' => '{checkSample}', 'buttons' => ['checkSample' => function ($url, $model, $key) {
$options = array_merge(['title' => 'Muestra entregada', 'aria-label' => 'Muetra entregada']);
$icon = $model->sample_delivered ? 'glyphicon-check' : 'glyphicon-unchecked';
return Html::a('<span class="glyphicon ' . $icon . '"></span>', $url, $options);
}], 'urlCreator' => function ($action, $model, $key, $index) {
$url = [''];
switch ($action) {
case 'checkSample':
$url = ['check-entry-sample', 'id' => $model->id, 'check' => !$model->sample_delivered, 'page' => Yii::$app->request->getQueryParam('page', null)];
break;
}
return Url::to($url);
示例3:
use yii\helpers\Html;
use yii\widgets\DetailView;
use app\models\Currency;
/* @var $this yii\web\View */
/* @var $model app\models\Receipt */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Facturas', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="receipt-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a('Editar', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('Eliminar', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => '¿Estas seguro de eliminar este elemento?', 'method' => 'post']]);
?>
</p>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['label' => 'Cliente', 'value' => $model->estimate->client->name], ['label' => 'Presupuesto', 'value' => $model->estimate->title], 'number', ['attribute' => 'created_date', 'format' => 'date'], ['label' => 'Tipo', 'value' => $model->typeLabel], ['label' => 'Estado', 'value' => $model->statusLabel], ['label' => 'Neto', 'value' => Currency::format($model->estimate->total_checked, Currency::CURRENCY_ARS)], ['attribute' => 'iva', 'value' => $model->iva / 100, 'format' => ['percent', 2]], ['label' => 'Bruto', 'value' => Currency::format($model->gross, Currency::CURRENCY_ARS)]]]);
?>
</div>
示例4: foreach
<?php
foreach ($group as $entry) {
?>
<div style="float: left; margin: 0; width: 58%; height: 1px;">
<?php
echo $entry->description;
?>
</div>
<div style="float: left; margin: 0; width: 25%; text-align: center; height: 1px;">
<?php
echo $entry->quantity;
?>
</div>
<div style="float: left; margin: 0; text-align: center; height: 1px;">
<?php
echo Currency::format($entry->subtotal, Currency::CURRENCY_ARS);
?>
</div>
<?php
}
?>
</div>
<?php
}
?>
</div>
</div>
<?php
if (++$i < $qGroups) {
?>