Amount with currency: combination of a NumberType
input and a ChoiceType
input (for currency selection).
PrestaShopBundle\Form\Admin\Type
Option | Type | Default value | Description |
---|---|---|---|
label | boolean |
false |
|
amount_constraints | string |
[] |
|
inherit_data | boolean |
true |
|
currencies | array |
[] |
$builder
->add('amount_currency', AmountCurrencyType::class, [
'amount_constraints' => [
new NotNull(),
new GreaterThan([
'value' => 0,
'message' => $this->translator->trans(
'Invalid value: the payment must be a positive amount.', [], 'Admin.Notifications.Error'
),
]),
],
'currencies' => $this->currencySymbolByIdChoiceProvider->getChoices([
'id_shop' => $this->contextShopId,
]),
])