julienmonnerie/kirby/config/fields/slug.php

56 lines
934 B
PHP
Raw Normal View History

2022-06-17 17:51:59 +02:00
<?php
return [
2022-08-31 15:02:43 +02:00
'extends' => 'text',
'props' => [
/**
* Unset inherited props
*/
'converter' => null,
'counter' => null,
'spellcheck' => null,
2022-06-17 17:51:59 +02:00
2022-08-31 15:02:43 +02:00
/**
* Set of characters allowed in the slug
*/
'allow' => function (string $allow = '') {
return $allow;
},
2022-06-17 17:51:59 +02:00
2022-08-31 15:02:43 +02:00
/**
* Changes the link icon
*/
'icon' => function (string $icon = 'url') {
return $icon;
},
2022-06-17 17:51:59 +02:00
2022-08-31 15:02:43 +02:00
/**
* Set prefix for the help text
*/
2025-04-21 18:57:21 +02:00
'path' => function (string|null $path = null) {
2022-08-31 15:02:43 +02:00
return $path;
},
2022-06-17 17:51:59 +02:00
2022-08-31 15:02:43 +02:00
/**
* Name of another field that should be used to
* automatically update this field's value
*/
2025-04-21 18:57:21 +02:00
'sync' => function (string|null $sync = null) {
2022-08-31 15:02:43 +02:00
return $sync;
},
2022-06-17 17:51:59 +02:00
2022-08-31 15:02:43 +02:00
/**
* Set to object with keys `field` and `text` to add
* button to generate from another field
*/
'wizard' => function ($wizard = false) {
return $wizard;
}
],
'validations' => [
'minlength',
'maxlength'
],
2022-06-17 17:51:59 +02:00
];