Skip to content

Commit c22d32c

Browse files
committed
Add docs for BelgiumPostCodeType
1 parent 3a92f8e commit c22d32c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/development/forms.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,18 @@ Where `Username` is a translation. So if you want to translate the label, you ca
2929
```yaml
3030
Username: 'Enter your username'
3131
```
32+
33+
## Belgium postcode
34+
35+
Form type that allows only valid belgian postcodes to be selected.
36+
37+
Use in your own form:
38+
```php
39+
$builder->add('postcode', BelgiumPostCodeType::class);
40+
```
41+
42+
Add a property in the DTO:
43+
```php
44+
#[Assert\NotBlank]
45+
public ?BelgiumPostCode $postcode = null;
46+
```

0 commit comments

Comments
 (0)