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
cc636805
Commit
cc636805
authored
Jan 11, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1894: The path aliases `@webroot` and `@web` are now available right…
Fixes #1894: The path aliases `@webroot` and `@web` are now available right after the application is initialized
parent
b97cd2c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
Application.php
framework/web/Application.php
+11
-3
No files found.
framework/CHANGELOG.md
View file @
cc636805
...
@@ -57,6 +57,7 @@ Yii Framework 2 Change Log
...
@@ -57,6 +57,7 @@ Yii Framework 2 Change Log
-
Enh #1773: keyPrefix property of Cache is not restricted to alnum characters anymore, however it is still recommended (cebe)
-
Enh #1773: keyPrefix property of Cache is not restricted to alnum characters anymore, however it is still recommended (cebe)
-
Enh #1809: Added support for building "EXISTS" and "NOT EXISTS" query conditions (abdrasulov)
-
Enh #1809: Added support for building "EXISTS" and "NOT EXISTS" query conditions (abdrasulov)
-
Enh #1852: ActiveRecord::tableName() now returns table name using DbConnection::tablePrefix (creocoder)
-
Enh #1852: ActiveRecord::tableName() now returns table name using DbConnection::tablePrefix (creocoder)
-
Enh #1894: The path aliases
`@webroot`
and
`@web`
are now available right after the application is initialized (qiangxue)
-
Enh: Added
`favicon.ico`
and
`robots.txt`
to default application templates (samdark)
-
Enh: Added
`favicon.ico`
and
`robots.txt`
to default application templates (samdark)
-
Enh: Added
`Widget::autoIdPrefix`
to support prefixing automatically generated widget IDs (qiangxue)
-
Enh: Added
`Widget::autoIdPrefix`
to support prefixing automatically generated widget IDs (qiangxue)
-
Enh: Support for file aliases in console command 'message' (omnilight)
-
Enh: Support for file aliases in console command 'message' (omnilight)
...
...
framework/web/Application.php
View file @
cc636805
...
@@ -55,6 +55,17 @@ class Application extends \yii\base\Application
...
@@ -55,6 +55,17 @@ class Application extends \yii\base\Application
/**
/**
* @inheritdoc
*/
public
function
preloadComponents
()
{
parent
::
preloadComponents
();
$request
=
$this
->
getRequest
();
Yii
::
setAlias
(
'@webroot'
,
dirname
(
$request
->
getScriptFile
()));
Yii
::
setAlias
(
'@web'
,
$request
->
getBaseUrl
());
}
/**
* Handles the specified request.
* Handles the specified request.
* @param Request $request the request to be handled
* @param Request $request the request to be handled
* @return Response the resulting response
* @return Response the resulting response
...
@@ -62,9 +73,6 @@ class Application extends \yii\base\Application
...
@@ -62,9 +73,6 @@ class Application extends \yii\base\Application
*/
*/
public
function
handleRequest
(
$request
)
public
function
handleRequest
(
$request
)
{
{
Yii
::
setAlias
(
'@webroot'
,
dirname
(
$request
->
getScriptFile
()));
Yii
::
setAlias
(
'@web'
,
$request
->
getBaseUrl
());
if
(
empty
(
$this
->
catchAll
))
{
if
(
empty
(
$this
->
catchAll
))
{
list
(
$route
,
$params
)
=
$request
->
resolve
();
list
(
$route
,
$params
)
=
$request
->
resolve
();
}
else
{
}
else
{
...
...
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