Discovered an undoc feature "data-input-preset-prefix-input"... added to API as "prefixInput"

This commit is contained in:
Samuel Georges 2015-03-07 11:14:03 +11:00
parent 69542c311c
commit 8ca1f8b7a3
2 changed files with 6 additions and 0 deletions

View File

@ -10,6 +10,8 @@
* for the source and destination input elements.
* - data-input-preset-type: specifies the conversion type. Supported values are:
* url, file, slug, camel.
* - data-input-preset-prefix-input: optional, prefixes the converted value with the value found
* in the supplied input element using a CSS selector.
*
* Example: <input type="text" id="name" value=""/>
* <input type="text"

View File

@ -458,6 +458,10 @@ class FormField
'data-input-preset-closest-parent' => 'form'
];
if ($prefixInput = array_get($this->preset, 'prefixInput')) {
$newAttributes['data-input-preset-prefix-input'] = $prefixInput;
}
$attributes = $attributes + $newAttributes;
return $attributes;
}