silverstripe-userforms/code/Modifier/UnderscoreSegmentFieldModifier.php
2022-04-13 13:52:56 +12:00

19 lines
449 B
PHP

<?php
namespace SilverStripe\UserForms\Modifier;
use SilverStripe\Forms\SegmentFieldModifier\SlugSegmentFieldModifier;
class UnderscoreSegmentFieldModifier extends SlugSegmentFieldModifier
{
public function getPreview($value)
{
return str_replace('-', '_', parent::getPreview($value) ?? '');
}
public function getSuggestion($value)
{
return str_replace('-', '_', parent::getSuggestion($value) ?? '');
}
}