0
Ich habe eine _form.php Datei mit diesem Feld:Yii2: Wie Eingangsnummer zu Währung es-AR formatieren?
<?=
$form->field($model, 'price')
->textInput([
'class' => 'form-control',
'type' => 'number'
])
?>
Der Preis dieses Format hat 1234.50
. Ich hätte gerne das Format es-AR, so: 1234,50
.
Im Grid von index.php Ich benutze diesen Code und es funktioniert super, so würde Ich mag die gleichen in der _form tun, aber es funktioniert nicht.
[
'attribute' => 'price',
'value' => function($myModel) {
$myFormat = new NumberFormatter("es-AR", NumberFormatter::CURRENCY);
return $myFormat->formatCurrency($myModel->price, "ARS");
},
]
Sie die currencty Formatierer direcly in Hauptkomponente einstellen https://stackoverflow.com/questions/31201 293/yii2-how-to-set-währungs-in-main-config – scaisEdge