You are here

class FrontPagePathProcessor in Front Page 8

Same name and namespace in other branches
  1. 9.1.x src/FrontPagePathProcessor.php \Drupal\front_page\FrontPagePathProcessor

Class FrontPagePathProcessor.

@package Drupal\front_page

Hierarchy

Expanded class hierarchy of FrontPagePathProcessor

1 string reference to 'FrontPagePathProcessor'
front_page.services.yml in ./front_page.services.yml
front_page.services.yml
1 service uses FrontPagePathProcessor
front_page.front_page_path_processor in ./front_page.services.yml
Drupal\front_page\FrontPagePathProcessor

File

src/FrontPagePathProcessor.php, line 14

Namespace

Drupal\front_page
View 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