silverstripe-userforms/code/Modifier/UnderscoreSegmentFieldModifier.php

19 lines
437 B
PHP
Raw Normal View History

2015-08-11 22:57:19 +02:00
<?php
namespace SilverStripe\UserForms\Modifier;
2015-08-11 22:57:19 +02:00
use SilverStripe\Forms\SegmentFieldModifier\SlugSegmentFieldModifier;
2016-07-21 07:53:59 +02:00
class UnderscoreSegmentFieldModifier extends SlugSegmentFieldModifier
{
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
public function getSuggestion($value)
{
return str_replace('-', '_', parent::getSuggestion($value));
}
2015-08-11 22:57:19 +02:00
}