From a0c88ff75794b20ad2b5b16c5759754ad7f6a7ac Mon Sep 17 00:00:00 2001 From: ohartl Date: Fri, 4 Mar 2016 11:47:11 +0100 Subject: [PATCH] Move error templates in another location --- include/php/classes/Router.php | 15 +++++++++++---- .../php/{pages => template/error}/not-allowed.php | 0 .../404.php => template/error/not-found.php} | 0 3 files changed, 11 insertions(+), 4 deletions(-) rename include/php/{pages => template/error}/not-allowed.php (100%) rename include/php/{pages/404.php => template/error/not-found.php} (100%) diff --git a/include/php/classes/Router.php b/include/php/classes/Router.php index dc54bda..be5eace 100644 --- a/include/php/classes/Router.php +++ b/include/php/classes/Router.php @@ -16,8 +16,8 @@ class Router * @var array */ private static $errorPages = array( - 404 => 'include/php/pages/404.php', - 403 => 'include/php/pages/not-allowed.php' + 404 => 'include/php/template/error/not-found.php', + 403 => 'include/php/template/error/not-allowed.php' ); @@ -225,9 +225,16 @@ public static function loadAndBufferOutput($file, $variables = array()) * * @return string */ - public static function url($url) + public static function url($url = '') { - return sprintf('%s/%s', rtrim(Config::get('base_url'), '/'), trim($url, '/')); + return rtrim( + sprintf( + '%s/%s', + rtrim(Config::get('base_url'), '/'), + trim($url, '/') + ), + '/' + ); } diff --git a/include/php/pages/not-allowed.php b/include/php/template/error/not-allowed.php similarity index 100% rename from include/php/pages/not-allowed.php rename to include/php/template/error/not-allowed.php diff --git a/include/php/pages/404.php b/include/php/template/error/not-found.php similarity index 100% rename from include/php/pages/404.php rename to include/php/template/error/not-found.php