<!-- range of values -->
<?php
+
+$serversClass = $field['servers_model'];
+$servers = $serversClass::getAllServers();
+
+if ($field['default'] === '__FIRST__') {
+ foreach ($servers as $i => $server) {
+ $field['default'] = ['server' => $i, 'path' => ''];
+ }
+}
+
$empty = ['server' => '', 'path' => ''];
$value = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? $empty;
if ($value == '') {
$value['path'] = '';
}
-$serversClass = $field['servers_model'];
-$servers = $serversClass::getAllServers();
?>
@include('crud::fields.inc.wrapper_start')
function liveslugify(text) {
return text
.toString()// Cast to string (optional)
- .replace(/\/+/g,'fwdslash')
+ .replace(/\/+/g, 'fwdslash')
.normalize('NFKD') // The normalize() using NFKD method returns the Unicode Normalization Form of a given string.
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
-// .replace(/\_/g, '-') // Replace _ with -
+ // .replace(/\_/g, '-') // Replace _ with -
.replace(/\-\-+/g, '-') // Replace multiple - with single -
//.replace(/\-$/g, '') // Remove trailing -
- .replace(/fwdslash/g,'/');
+ .replace(/fwdslash/g, '/');
}
$(function () {