Commit 67af6bc8 by Alexander Makarov

Fixed inconsistent usage of getters

parent cb5a8896
...@@ -78,7 +78,7 @@ class BaseUrl ...@@ -78,7 +78,7 @@ class BaseUrl
if ($url !== '' && ($url[0] === '/' || $url[0] === '#' || strpos($url, '://') || !strncmp($url, './', 2))) { if ($url !== '' && ($url[0] === '/' || $url[0] === '#' || strpos($url, '://') || !strncmp($url, './', 2))) {
return $url; return $url;
} else { } else {
$prefix = $absolute ? Yii::$app->request->getHostInfo() : ''; $prefix = $absolute ? Yii::$app->getRequest()->getHostInfo() : '';
return $prefix . Yii::$app->getRequest()->getBaseUrl() . '/' . $url; return $prefix . Yii::$app->getRequest()->getBaseUrl() . '/' . $url;
} }
} }
...@@ -97,9 +97,9 @@ class BaseUrl ...@@ -97,9 +97,9 @@ class BaseUrl
} }
if ($name === null) { if ($name === null) {
Yii::$app->user->setReturnUrl($url); Yii::$app->getUser()->setReturnUrl($url);
} else { } else {
Yii::$app->session->set($name, $url); Yii::$app->getSession()->set($name, $url);
} }
} }
...@@ -112,9 +112,9 @@ class BaseUrl ...@@ -112,9 +112,9 @@ class BaseUrl
public function previous($name = null) public function previous($name = null)
{ {
if ($name === null) { if ($name === null) {
return Yii::$app->user->getReturnUrl(); return Yii::$app->getUser()->getReturnUrl();
} else { } else {
return Yii::$app->session->get($name); return Yii::$app->getSession()->get($name);
} }
} }
...@@ -136,7 +136,7 @@ class BaseUrl ...@@ -136,7 +136,7 @@ class BaseUrl
*/ */
public function home($absolute = false) public function home($absolute = false)
{ {
$prefix = $absolute ? Yii::$app->request->getHostInfo() : ''; $prefix = $absolute ? Yii::$app->getRequest()->getHostInfo() : '';
return $prefix . Yii::$app->getHomeUrl(); return $prefix . Yii::$app->getHomeUrl();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment