mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
28 lines
517 B
PHP
28 lines
517 B
PHP
<?php
|
|
|
|
use SilverStripe\Forms\SegmentFieldModifier\SlugSegmentFieldModifier;
|
|
|
|
class UnderscoreSegmentFieldModifier extends SlugSegmentFieldModifier {
|
|
/**
|
|
* @inheritdoc
|
|
*
|
|
* @param string $value
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getPreview($value) {
|
|
return str_replace('-', '_', parent::getPreview($value));
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*
|
|
* @param string $value
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getSuggestion($value) {
|
|
return str_replace('-', '_', parent::getSuggestion($value));
|
|
}
|
|
}
|