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
241b6fc4
Commit
241b6fc4
authored
May 20, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified the IAssetConvert interface.
parent
5f23f631
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
12 deletions
+9
-12
AssetBundle.php
yii/web/AssetBundle.php
+2
-2
AssetConverter.php
yii/web/AssetConverter.php
+5
-6
IAssetConverter.php
yii/web/IAssetConverter.php
+2
-4
No files found.
yii/web/AssetBundle.php
View file @
241b6fc4
...
...
@@ -135,10 +135,10 @@ class AssetBundle extends Object
$this
->
publish
(
$view
->
getAssetManager
());
foreach
(
$this
->
js
as
$js
)
{
$view
->
registerJsFile
(
$js
,
$this
->
jsOptions
);
$view
->
registerJsFile
(
$
this
->
baseUrl
.
'/'
.
$
js
,
$this
->
jsOptions
);
}
foreach
(
$this
->
css
as
$css
)
{
$view
->
registerCssFile
(
$css
,
$this
->
cssOptions
);
$view
->
registerCssFile
(
$
this
->
baseUrl
.
'/'
.
$
css
,
$this
->
cssOptions
);
}
}
...
...
yii/web/AssetConverter.php
View file @
241b6fc4
...
...
@@ -34,13 +34,12 @@ class AssetConverter extends Component implements IAssetConverter
* Converts a given asset file into a CSS or JS file.
* @param string $asset the asset file path, relative to $basePath
* @param string $basePath the directory the $asset is relative to.
* @param string $baseUrl the URL corresponding to $basePath
* @return string the URL to the converted asset file.
* @return string the converted asset file path, relative to $basePath.
*/
public
function
convert
(
$asset
,
$basePath
,
$baseUrl
)
public
function
convert
(
$asset
,
$basePath
)
{
$pos
=
strrpos
(
$asset
,
'.'
);
if
(
$pos
!
==
false
)
{
if
(
$pos
=
==
false
)
{
$ext
=
substr
(
$asset
,
$pos
+
1
);
if
(
isset
(
$this
->
commands
[
$ext
]))
{
list
(
$ext
,
$command
)
=
$this
->
commands
[
$ext
];
...
...
@@ -54,9 +53,9 @@ class AssetConverter extends Component implements IAssetConverter
exec
(
$command
,
$output
);
Yii
::
info
(
"Converted
$asset
into
$result
: "
.
implode
(
"
\n
"
,
$output
),
__METHOD__
);
}
return
"
$baseUrl
/
$result
"
;
return
$result
;
}
}
return
"
$baseUrl
/
$asset
"
;
return
$asset
;
}
}
yii/web/IAssetConverter.php
View file @
241b6fc4
...
...
@@ -19,9 +19,7 @@ interface IAssetConverter
* Converts a given asset file into a CSS or JS file.
* @param string $asset the asset file path, relative to $basePath
* @param string $basePath the directory the $asset is relative to.
* @param string $baseUrl the URL corresponding to $basePath
* @return string the URL to the converted asset file. If the given asset does not
* need conversion, "$baseUrl/$asset" should be returned.
* @return string the converted asset file path, relative to $basePath.
*/
public
function
convert
(
$asset
,
$basePath
,
$baseUrl
);
public
function
convert
(
$asset
,
$basePath
);
}
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