mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
19 lines
449 B
PHP
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) ?? '');
|
|
}
|
|
}
|