Adds the Slugify service.

This commit is contained in:
2021-02-18 07:50:05 +00:00
parent 30499228c8
commit abcdd135cb
3 changed files with 71 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace Drupal\cdesai_tff;
use Drupal\Core\Field\FieldItemInterface;
interface SlugifyServiceInterface {
const CONFIG_NAME = 'cdesai_tff.settings';
const DEFAULT_SEPARATOR = '_';
/**
* Converts the given item to slug format.
*
* @param \Drupal\Core\Field\FieldItemInterface $item
* Field item object that needs to be converted.
*
* @param string|null $separator (optional)
* Separator to use for slug. Defaults to '_'.
*
* @return string
* The converted string.
*/
public function convertToSlug(FieldItemInterface $item, $separator = NULL);
}