From 7ded6e5fedbd83b59f968813f90d2f1679178275 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 11 Sep 2014 12:44:52 +0800 Subject: [PATCH 1/3] Update Controller.php --- modules/cms/classes/Controller.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 67a974799..3a0de1479 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -807,10 +807,11 @@ class Controller extends BaseController * @param mixed $name Specifies the Cms Page file name. * @param array $parameters Route parameters to consider in the URL. * @param bool $routePersistence By default the existing routing parameters will be included + * @param bool $absolute If True - create absolute URL path, if False - create relative URL path * when creating the URL, set to false to disable this feature. * @return string */ - public function pageUrl($name, $parameters = [], $routePersistence = true) + public function pageUrl($name, $parameters = [], $routePersistence = true, $absolute = true) { if (!$name) return null; @@ -832,7 +833,7 @@ class Controller extends BaseController if (substr($url, 0, 1) == '/') $url = substr($url, 1); - return URL::action('Cms\Classes\Controller@run', ['slug' => $url]); + return URL::action('Cms\Classes\Controller@run', ['slug' => $url], $absolute); } /** @@ -1001,4 +1002,4 @@ class Controller extends BaseController // return null; // } -} \ No newline at end of file +} From 8ee57eee767fe87ebdb44296edc64570816e0ed7 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 11 Sep 2014 12:45:37 +0800 Subject: [PATCH 2/3] Update Page.php --- modules/cms/classes/Page.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/cms/classes/Page.php b/modules/cms/classes/Page.php index a51df7695..17199f218 100644 --- a/modules/cms/classes/Page.php +++ b/modules/cms/classes/Page.php @@ -92,9 +92,9 @@ class Page extends CmsCompoundObject * Helper that makes a URL for a page in the active theme. * @return string */ - public static function url($page, $params = []) + public static function url($page, $params = [], $absolute = true) { $controller = new Controller; - return $controller->pageUrl($page, $params); + return $controller->pageUrl($page, $params, true, $absolute); } } From 1fa9837f6c194788acec116e279f7aaac871c549 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 11 Sep 2014 12:45:50 +0800 Subject: [PATCH 3/3] Update Page.php