1549e175d4b916363ce17defac0430f4a9add881
[yaffs-website] / web / modules / contrib / front / src / FrontPagePathProcessor.php
1 <?php
2
3 namespace Drupal\front_page;
4
5 use Drupal\Core\PathProcessor\OutboundPathProcessorInterface;
6 use Drupal\Core\Render\BubbleableMetadata;
7 use Symfony\Component\HttpFoundation\Request;
8
9 class FrontPagePathProcessor implements OutboundPathProcessorInterface {
10
11   /**
12    * {@inheritdoc}
13    */
14   public function processOutbound($path, &$options = array(), Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
15     if ($path == '/main') {
16       $path = '';
17     }
18     $config  = \Drupal::config('front_page.settings');
19     $new_path = $config->get('home_link_path', '');
20     if (($path === '/<front>' || empty($path)) && !empty($new_path)) {
21       $path = '/' . $new_path;
22     }
23     return $path;
24   }
25
26 }
27 ?>