| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace Atk4\Ui\Form\Control; |
| 6: | |
| 7: | class Money extends Input |
| 8: | { |
| 9: | public string $inputType = 'text'; |
| 10: | |
| 11: | #[\Override] |
| 12: | public function getValue() |
| 13: | { |
| 14: | $res = parent::getValue(); |
| 15: | if ($res === null) { |
| 16: | return null; |
| 17: | } |
| 18: | |
| 19: | $res = str_replace("\u{00a0}" , ' ', $res); |
| 20: | |
| 21: | return trim(str_replace($this->getApp()->uiPersistence->currency, '', $res)); |
| 22: | } |
| 23: | |
| 24: | #[\Override] |
| 25: | protected function renderView(): void |
| 26: | { |
| 27: | if ($this->label === null) { |
| 28: | $this->label = $this->getApp()->uiPersistence->currency; |
| 29: | } |
| 30: | |
| 31: | parent::renderView(); |
| 32: | } |
| 33: | } |
| 34: | |