Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
2cd5f982
Commit
2cd5f982
authored
Mar 09, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed methods, added Url::getHome
parent
14fc5bd1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
BaseUrl.php
framework/helpers/BaseUrl.php
+15
-4
No files found.
framework/helpers/BaseUrl.php
View file @
2cd5f982
...
...
@@ -57,7 +57,7 @@ class BaseUrl
if
(
$url
!==
''
&&
(
$url
[
0
]
===
'/'
||
$url
[
0
]
===
'#'
||
strpos
(
$url
,
'://'
)
||
!
strncmp
(
$url
,
'./'
,
2
)))
{
return
$url
;
}
else
{
return
static
::
asset
(
$url
);
return
static
::
base
(
$url
);
}
}
}
...
...
@@ -68,7 +68,7 @@ class BaseUrl
* @param string $url relative URL
* @return string absolute URL
*/
public
function
asset
(
$url
)
public
function
base
(
$url
)
{
return
Yii
::
$app
->
getRequest
()
->
getBaseUrl
()
.
'/'
.
$url
;
}
...
...
@@ -76,7 +76,7 @@ class BaseUrl
/**
* Sets current URL as return URL
*/
public
function
rememberReturn
Url
()
public
function
rememberReturn
()
{
Yii
::
$app
->
user
->
setReturnUrl
(
Yii
::
$app
->
getRequest
()
->
getUrl
());
}
...
...
@@ -86,9 +86,19 @@ class BaseUrl
*
* @return string canonical URL
*/
public
function
c
anonical
()
public
function
getC
anonical
()
{
return
Yii
::
$app
->
controller
->
getCanonicalUrl
();
}
/**
* Returns home URL
*
* @return string home URL
*/
public
function
getHome
()
{
return
Yii
::
$app
->
getHomeUrl
();
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment