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
428d9128
Commit
428d9128
authored
Apr 13, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
script WIP
parent
c1428a17
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
3 deletions
+41
-3
Application.php
framework/base/Application.php
+26
-1
ViewContent.php
framework/base/ViewContent.php
+15
-2
No files found.
framework/base/Application.php
View file @
428d9128
...
...
@@ -87,7 +87,6 @@ class Application extends Module
*/
public
$layout
=
'main'
;
private
$_runtimePath
;
private
$_ended
=
false
;
/**
...
...
@@ -224,6 +223,8 @@ class Application extends Module
return
0
;
}
private
$_runtimePath
;
/**
* Returns the directory that stores runtime files.
* @return string the directory that stores runtime files. Defaults to 'protected/runtime'.
...
...
@@ -251,6 +252,30 @@ class Application extends Module
}
}
private
$_vendorPath
;
/**
* Returns the directory that stores vendor files.
* @return string the directory that stores vendor files. Defaults to 'protected/vendor'.
*/
public
function
getVendorPath
()
{
if
(
$this
->
_vendorPath
!==
null
)
{
$this
->
setVendorPath
(
$this
->
getBasePath
()
.
DIRECTORY_SEPARATOR
.
'vendor'
);
}
return
$this
->
_vendorPath
;
}
/**
* Sets the directory that stores vendor files.
* @param string $path the directory that stores vendor files.
* @throws InvalidConfigException if the directory does not exist
*/
public
function
setVendorPath
(
$path
)
{
$this
->
_vendorPath
=
FileHelper
::
ensureDirectory
(
$path
);
}
/**
* Returns the time zone used by this application.
* This is a simple wrapper of PHP function date_default_timezone_get().
...
...
framework/base/ViewContent.php
View file @
428d9128
...
...
@@ -7,6 +7,8 @@
namespace
yii\base
;
use
Yii
;
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
...
...
@@ -43,7 +45,6 @@ class ViewContent extends Component
* ~~~
*/
public
$bundles
;
public
$title
;
public
$metaTags
;
public
$linkTags
;
...
...
@@ -68,9 +69,21 @@ class ViewContent extends Component
$this
->
jsFiles
=
null
;
}
public
function
re
gisterBundle
(
$name
)
public
function
re
nderScripts
(
$pos
)
{
}
public
function
registerBundle
(
$name
)
{
if
(
!
isset
(
$this
->
bundles
[
$name
]))
{
$am
=
Yii
::
$app
->
assets
;
$bundle
=
$am
->
getBundle
(
$name
);
if
(
$bundle
!==
null
)
{
$this
->
bundles
[
$name
]
=
$bundle
;
}
else
{
throw
new
InvalidConfigException
(
"Asset bundle does not exist:
$name
"
);
}
}
}
public
function
getMetaTag
(
$key
)
...
...
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