class TrailingSlashHelper in Trailing Slash 8
Class TrailingSlashHelper
@package Drupal\trailing_slash\Helper\Url
Hierarchy
- class \Drupal\trailing_slash\Helper\Url\TrailingSlashHelper
Expanded class hierarchy of TrailingSlashHelper
2 files declare their use of TrailingSlashHelper
- TrailingSlashOutboundPathProcessor.php in src/
PathProcessor/ TrailingSlashOutboundPathProcessor.php - TrailingSlashUrlGenerator.php in src/
Routing/ TrailingSlashUrlGenerator.php
File
- src/
Helper/ Url/ TrailingSlashHelper.php, line 10
Namespace
Drupal\trailing_slash\Helper\UrlView source
class TrailingSlashHelper {
/**
* Add a slash at the end if you do not have one.
*
* @param $path
*/
public static function add(&$path) {
$path = preg_replace('/((?:^|\\/)[^\\/\\.]+?)$/isD', '$1/', $path);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TrailingSlashHelper:: |
public static | function | Add a slash at the end if you do not have one. |