You are here

public function StringTransformTrait::toTitleCase in Drupal 7 to 8/9 Module Upgrader 8

Converts a string ToTitleCase.

Parameters

string $string: The string to convert.

Return value

string

5 calls to StringTransformTrait::toTitleCase()
Blocks::convert in src/Plugin/DMU/Converter/Blocks.php
Performs required conversions.
FormConverter::render in src/Utility/FormConverter.php
HookEntityInfo::convert in src/Plugin/DMU/Converter/HookEntityInfo.php
Performs required conversions.
HookFieldFormatterInfo::convert in src/Plugin/DMU/Converter/HookFieldFormatterInfo.php
Performs required conversions.
HookFieldWidgetInfo::convert in src/Plugin/DMU/Converter/HookFieldWidgetInfo.php
Performs required conversions.

File

src/Utility/StringTransformTrait.php, line 32

Class

StringTransformTrait
Contains methods for transforming strings in various helpful ways.

Namespace

Drupal\drupalmoduleupgrader\Utility

Code

public function toTitleCase($string) {
  $string = $this
    ->toCamelCase($string);
  $string[0] = strtoupper($string[0]);
  return $string;
}