summaryrefslogtreecommitdiff
path: root/src/Routing/LegacyUrlGenerator.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-09-04 18:35:13 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-09-04 21:13:28 +0200
commitb52444af8a289e089d1239657cdf6ff06b21b29d (patch)
treec2754b3049a50ad6743841a609ab0574f241720d /src/Routing/LegacyUrlGenerator.php
parentb320fc779063ee80b8f0ba505cb323287ccccbf5 (diff)
parenta1bc763a16ee8be109de5c9053fbc5eded53824e (diff)
Merge remote-tracking branch 'MyIgel/routing'
Diffstat (limited to 'src/Routing/LegacyUrlGenerator.php')
-rw-r--r--src/Routing/LegacyUrlGenerator.php31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/Routing/LegacyUrlGenerator.php b/src/Routing/LegacyUrlGenerator.php
deleted file mode 100644
index fdac4f96..00000000
--- a/src/Routing/LegacyUrlGenerator.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-namespace Engelsystem\Routing;
-
-/**
- * Provides urls when webserver rewriting is disabled.
- *
- * The urls have the form <app url>/index.php?p=<path>&<parameters>
- */
-class LegacyUrlGenerator extends UrlGenerator
-{
- /**
- * @param string $path
- * @param array $parameters
- * @return string urls in the form <app url>/index.php?p=<path>&<parameters>
- */
- public function linkTo($path, $parameters = [])
- {
- $page = ltrim($path, '/');
- if (!empty($page)) {
- $page = str_replace('-', '_', $page);
- $parameters = array_merge(['p' => $page], $parameters);
- }
-
- $uri = parent::linkTo('index.php', $parameters);
- $uri = preg_replace('~(/index\.php)+~', '/index.php', $uri);
- $uri = preg_replace('~(/index\.php)$~', '/', $uri);
-
- return $uri;
- }
-}