diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-06-13 13:08:01 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-07-23 21:19:21 +0200 |
commit | 9c75f877935fa6adec951a4d8d32b328aaab314f (patch) | |
tree | 1cdd09ddfc00c6cebb92bb2b90381a06fd31246d /application/front/controller/visitor/ShaarliVisitorController.php | |
parent | 818b3193ffabec57501e3bdfa997206e3c0671ef (diff) | |
download | Shaarli-9c75f877935fa6adec951a4d8d32b328aaab314f.tar.gz Shaarli-9c75f877935fa6adec951a4d8d32b328aaab314f.tar.zst Shaarli-9c75f877935fa6adec951a4d8d32b328aaab314f.zip |
Use multi-level routes for existing controllers instead of 1 level everywhere
Also prefix most admin routes with /admin/
Diffstat (limited to 'application/front/controller/visitor/ShaarliVisitorController.php')
-rw-r--r-- | application/front/controller/visitor/ShaarliVisitorController.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/application/front/controller/visitor/ShaarliVisitorController.php b/application/front/controller/visitor/ShaarliVisitorController.php index b90b1e8f..b494a8e6 100644 --- a/application/front/controller/visitor/ShaarliVisitorController.php +++ b/application/front/controller/visitor/ShaarliVisitorController.php | |||
@@ -105,6 +105,19 @@ abstract class ShaarliVisitorController | |||
105 | } | 105 | } |
106 | 106 | ||
107 | /** | 107 | /** |
108 | * Simple helper which prepend the base path to redirect path. | ||
109 | * | ||
110 | * @param Response $response | ||
111 | * @param string $path Absolute path, e.g.: `/`, or `/admin/shaare/123` regardless of install directory | ||
112 | * | ||
113 | * @return Response updated | ||
114 | */ | ||
115 | protected function redirect(Response $response, string $path): Response | ||
116 | { | ||
117 | return $response->withRedirect($this->container->basePath . $path); | ||
118 | } | ||
119 | |||
120 | /** | ||
108 | * Generates a redirection to the previous page, based on the HTTP_REFERER. | 121 | * Generates a redirection to the previous page, based on the HTTP_REFERER. |
109 | * It fails back to the home page. | 122 | * It fails back to the home page. |
110 | * | 123 | * |