public static function TrailingSlashHelper::add in Trailing Slash 8
Add a slash at the end if you do not have one.
Parameters
$path:
2 calls to TrailingSlashHelper::add()
- TrailingSlashOutboundPathProcessor::processOutbound in src/
PathProcessor/ TrailingSlashOutboundPathProcessor.php - @inheritdoc
- TrailingSlashUrlGenerator::fixFrontMultilingualUrl in src/
Routing/ TrailingSlashUrlGenerator.php
File
- src/
Helper/ Url/ TrailingSlashHelper.php, line 17
Class
- TrailingSlashHelper
- Class TrailingSlashHelper
Namespace
Drupal\trailing_slash\Helper\UrlCode
public static function add(&$path) {
$path = preg_replace('/((?:^|\\/)[^\\/\\.]+?)$/isD', '$1/', $path);
}