class FrontPagePathProcessor in Front Page 8
Same name and namespace in other branches
- 9.1.x src/FrontPagePathProcessor.php \Drupal\front_page\FrontPagePathProcessor
Class FrontPagePathProcessor.
@package Drupal\front_page
Hierarchy
- class \Drupal\front_page\FrontPagePathProcessor implements OutboundPathProcessorInterface
Expanded class hierarchy of FrontPagePathProcessor
1 string reference to 'FrontPagePathProcessor'
1 service uses FrontPagePathProcessor
File
- src/
FrontPagePathProcessor.php, line 14
Namespace
Drupal\front_pageView source
class FrontPagePathProcessor implements OutboundPathProcessorInterface {
/**
* {@inheritdoc}
*/
public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
if ($path == '/main') {
$path = '';
}
$config = \Drupal::config('front_page.settings');
$new_path = $config
->get('home_link_path', '');
if (($path === '/<front>' || empty($path)) && !empty($new_path)) {
$path = '/' . $new_path;
}
return $path;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FrontPagePathProcessor:: |
public | function |
Processes the outbound path. Overrides OutboundPathProcessorInterface:: |