silverstripe-userforms/code/modifiers/UnderscoreSegmentFieldModifier.php

31 lines
591 B
PHP
Raw Normal View History

2015-08-11 22:57:19 +02:00
<?php
use SilverStripe\Forms\SegmentFieldModifier\SlugSegmentFieldModifier;
2016-07-21 07:53:59 +02:00
class UnderscoreSegmentFieldModifier extends SlugSegmentFieldModifier
{
/**
* @inheritdoc
*
* @param string $value
*
* @return string
*/
public function getPreview($value)
{
return str_replace('-', '_', parent::getPreview($value));
}
2015-08-11 22:57:19 +02:00
2016-07-21 07:53:59 +02:00
/**
* @inheritdoc
*
* @param string $value
*
* @return string
*/
public function getSuggestion($value)
{
return str_replace('-', '_', parent::getSuggestion($value));
}
2015-08-11 22:57:19 +02:00
}