Skip to content

Commit 3fbff8e

Browse files
committed
Added list of fields to README.md
1 parent ba4a90e commit 3fbff8e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,37 @@ public function handleForm()
104104
}
105105
```
106106

107+
## Available Fields
108+
109+
```php
110+
// All fields has the following common arguments:
111+
$args = [
112+
PHPForm\Widgets\Widget $widget,
113+
string $label = null,
114+
string $help_text = '',
115+
bool $required = false,
116+
bool $disabled = false,
117+
mixed $initial = null,
118+
array $validators = array(),
119+
array $widget_attrs = array(),
120+
array $error_messages = array()
121+
]
122+
123+
// Fields available
124+
// '...' represents common fields
125+
126+
new BooleanField([...]);
127+
new CharField([int $max_length, int $min_length, ...]);
128+
new ChoiceField([array $choices, ...]);
129+
new DateField([string $format, ...]);
130+
new DateTimeField([string $format, ...]);
131+
new EmailField([...]);
132+
new FileField([int $max_size, array $valid_filetypes, ...]);
133+
new IntegerField([int $max_value, int $min_value, ...]);
134+
new URLField([...]);
135+
136+
```
137+
107138
## Starting development
108139
Start by cloning the repo:
109140

0 commit comments

Comments
 (0)