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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
c852ba45
Commit
c852ba45
authored
Oct 17, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5617 from pana1990/patch-1
refactoring code
parents
8c50ee9e
8c8b7a77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
AssetPanel.php
extensions/debug/panels/AssetPanel.php
+8
-11
No files found.
extensions/debug/panels/AssetPanel.php
View file @
c852ba45
...
...
@@ -51,9 +51,6 @@ class AssetPanel extends Panel
public
function
save
()
{
$bundles
=
Yii
::
$app
->
view
->
assetManager
->
bundles
;
if
(
empty
(
$bundles
))
{
return
[];
}
$data
=
[];
foreach
(
$bundles
as
$name
=>
$bundle
)
{
if
(
$bundle
instanceof
AssetBundle
)
{
...
...
@@ -65,9 +62,9 @@ class AssetPanel extends Panel
/**
* Additional formatting for view.
*
*
* @param AssetBundle[] $bundles Array of bundles to formatting.
*
*
* @return AssetManager
*/
protected
function
format
(
array
$bundles
)
...
...
@@ -76,7 +73,7 @@ class AssetPanel extends Panel
$this
->
cssCount
+=
count
(
$bundle
->
css
);
$this
->
jsCount
+=
count
(
$bundle
->
js
);
array_walk
(
$bundle
->
css
,
function
(
&
$file
,
$key
,
$userdata
)
{
$file
=
Html
::
a
(
$file
,
$userdata
->
baseUrl
.
'/'
.
$file
,
[
'target'
=>
'_blank'
]);
},
$bundle
);
...
...
@@ -88,18 +85,18 @@ class AssetPanel extends Panel
array_walk
(
$bundle
->
depends
,
function
(
&
$depend
)
{
$depend
=
Html
::
a
(
$depend
,
'#'
.
$depend
);
});
$this
->
formatOptions
(
$bundle
->
publishOptions
);
$this
->
formatOptions
(
$bundle
->
jsOptions
);
$this
->
formatOptions
(
$bundle
->
cssOptions
);
}
return
$bundles
;
}
/**
* Format associative array of params to simple value.
*
*
* @param array $params
*
* @return array
...
...
@@ -109,11 +106,11 @@ class AssetPanel extends Panel
if
(
!
is_array
(
$params
))
{
return
$params
;
}
foreach
(
$params
as
$param
=>
$value
)
{
$params
[
$param
]
=
Html
::
tag
(
'strong'
,
'\''
.
$param
.
'\' => '
)
.
(
string
)
$value
;
}
return
$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