Adds the Slugify service.
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user