'label' => 'login',
'value' => $user['name'],
'target' => NULL,
- 'pattern' => "[a-z0-9-]+",
- 'size' => 10,
+ 'attr' => [
+ 'pattern' => "[a-z0-9-]+",
+ 'size' => 10,
+ ],
],
'name' => [
'label' => 'volledige naam',
'avatar' => [
'label' => 'portretfoto',
'type' => 'file',
+ 'attr' => [
+ 'accept' => "image/jpeg",
+ ],
'filename' => 'avatar.jpg',
],
'tags' => [
'value' => htmlspecialchars(@$colconf['value']),
'placeholder' => "Niet ingesteld",
'readonly' => empty($colconf['target']),
- 'pattern' => @$colconf['pattern'] ?: FALSE,
- 'size' => @$colconf['size'] ?: FALSE,
- ];
- if (@$colconf['type'] == 'file') {
- $attrs['accept'] = "image/jpeg";
- }
+ ] + (@$colconf['attr'] ?: []);
print '<input';
foreach ($attrs as $attr => $attrval) {