Same name in other branches
  1. 8.x-4.x src/FormatAddonsName.php \Drupal\views_slideshow\FormatAddonsName

Provides a class to manipulate addons names.

Hierarchy

Expanded class hierarchy of FormatAddonsName

1 string reference to 'FormatAddonsName'
views_slideshow.services.yml in ./views_slideshow.services.yml
views_slideshow.services.yml
1 service uses FormatAddonsName
views_slideshow.format_addons_name in ./views_slideshow.services.yml
Drupal\views_slideshow\FormatAddonsName

File

src/FormatAddonsName.php, line 8

Namespace

Drupal\views_slideshow
View source
class FormatAddonsName implements FormatAddonsNameInterface {
    
    /**
     * Format callback to move from underscore separated words to camelCase.
     */
    public function format($subject) {
        return preg_replace_callback('/_(.?)/', function ($matches) {
            if (isset($matches[1])) {
                return strtoupper($matches[1]);
            }
        }, $subject);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
FormatAddonsName::format public function Format callback to move from underscore separated words to camelCase. Overrides FormatAddonsNameInterface::format