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
e5569dc1
Commit
e5569dc1
authored
Aug 05, 2013
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow Url creation with Html::url in console context
fixes #718
parent
0565b758
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
HtmlBase.php
framework/yii/helpers/HtmlBase.php
+3
-2
No files found.
framework/yii/helpers/HtmlBase.php
View file @
e5569dc1
...
@@ -1339,11 +1339,12 @@ class HtmlBase
...
@@ -1339,11 +1339,12 @@ class HtmlBase
*
*
* - is an empty string: the currently requested URL will be returned;
* - is an empty string: the currently requested URL will be returned;
* - is a non-empty string: it will first be processed by [[Yii::getAlias()]]. If the result
* - is a non-empty string: it will first be processed by [[Yii::getAlias()]]. If the result
* is an absolute URL, it will be returned with any change further; Otherwise, the result
* is an absolute URL, it will be returned with
out
any change further; Otherwise, the result
* will be prefixed with [[\yii\web\Request::baseUrl]] and returned.
* will be prefixed with [[\yii\web\Request::baseUrl]] and returned.
* - is an array: the first array element is considered a route, while the rest of the name-value
* - is an array: the first array element is considered a route, while the rest of the name-value
* pairs are treated as the parameters to be used for URL creation using [[\yii\web\Controller::createUrl()]].
* pairs are treated as the parameters to be used for URL creation using [[\yii\web\Controller::createUrl()]].
* For example: `array('post/index', 'page' => 2)`, `array('index')`.
* For example: `array('post/index', 'page' => 2)`, `array('index')`.
* In case there is no controller, [[\yii\web\UrlManager::createUrl()]] will be used.
*
*
* @param array|string $url the parameter to be used to generate a valid URL
* @param array|string $url the parameter to be used to generate a valid URL
* @return string the normalized URL
* @return string the normalized URL
...
@@ -1355,7 +1356,7 @@ class HtmlBase
...
@@ -1355,7 +1356,7 @@ class HtmlBase
if
(
isset
(
$url
[
0
]))
{
if
(
isset
(
$url
[
0
]))
{
$route
=
$url
[
0
];
$route
=
$url
[
0
];
$params
=
array_splice
(
$url
,
1
);
$params
=
array_splice
(
$url
,
1
);
if
(
Yii
::
$app
->
controller
!==
null
)
{
if
(
Yii
::
$app
->
controller
instanceof
\yii\web\Controller
)
{
return
Yii
::
$app
->
controller
->
createUrl
(
$route
,
$params
);
return
Yii
::
$app
->
controller
->
createUrl
(
$route
,
$params
);
}
else
{
}
else
{
return
Yii
::
$app
->
getUrlManager
()
->
createUrl
(
$route
,
$params
);
return
Yii
::
$app
->
getUrlManager
()
->
createUrl
(
$route
,
$params
);
...
...
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