parent
9219d10137
commit
9b26d772a8
2 changed files with 6 additions and 10 deletions
|
@ -75,11 +75,9 @@ class Post extends Node implements ContentEntityBundleInterface {
|
|||
}
|
||||
|
||||
private function convertTermToHashtag(Term $tag): string {
|
||||
$tagName = strtolower($tag->label());
|
||||
$tagName = "#{$tagName}";
|
||||
$tagName = str_replace(' ', '-', $tagName);
|
||||
|
||||
return $tagName;
|
||||
return '#' . (new Collection(explode(' ', $tag->label())))
|
||||
->map(fn(string $word): string => ucfirst($word))
|
||||
->implode('');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue