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
60abeb0d
Commit
60abeb0d
authored
Jun 16, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed view to getView().
parent
4ef19b2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
FragmentCache.php
framework/yii/widgets/FragmentCache.php
+6
-6
No files found.
framework/yii/widgets/FragmentCache.php
View file @
60abeb0d
...
@@ -82,7 +82,7 @@ class FragmentCache extends Widget
...
@@ -82,7 +82,7 @@ class FragmentCache extends Widget
}
}
if
(
$this
->
getCachedContent
()
===
false
)
{
if
(
$this
->
getCachedContent
()
===
false
)
{
$this
->
view
->
cacheStack
[]
=
$this
;
$this
->
getView
()
->
cacheStack
[]
=
$this
;
ob_start
();
ob_start
();
ob_implicit_flush
(
false
);
ob_implicit_flush
(
false
);
}
}
...
@@ -100,14 +100,14 @@ class FragmentCache extends Widget
...
@@ -100,14 +100,14 @@ class FragmentCache extends Widget
echo
$content
;
echo
$content
;
}
elseif
(
$this
->
cache
instanceof
Cache
)
{
}
elseif
(
$this
->
cache
instanceof
Cache
)
{
$content
=
ob_get_clean
();
$content
=
ob_get_clean
();
array_pop
(
$this
->
view
->
cacheStack
);
array_pop
(
$this
->
getView
()
->
cacheStack
);
if
(
is_array
(
$this
->
dependency
))
{
if
(
is_array
(
$this
->
dependency
))
{
$this
->
dependency
=
Yii
::
createObject
(
$this
->
dependency
);
$this
->
dependency
=
Yii
::
createObject
(
$this
->
dependency
);
}
}
$data
=
array
(
$content
,
$this
->
dynamicPlaceholders
);
$data
=
array
(
$content
,
$this
->
dynamicPlaceholders
);
$this
->
cache
->
set
(
$this
->
calculateKey
(),
$data
,
$this
->
duration
,
$this
->
dependency
);
$this
->
cache
->
set
(
$this
->
calculateKey
(),
$data
,
$this
->
duration
,
$this
->
dependency
);
if
(
empty
(
$this
->
view
->
cacheStack
)
&&
!
empty
(
$this
->
dynamicPlaceholders
))
{
if
(
empty
(
$this
->
getView
()
->
cacheStack
)
&&
!
empty
(
$this
->
dynamicPlaceholders
))
{
$content
=
$this
->
updateDynamicContent
(
$content
,
$this
->
dynamicPlaceholders
);
$content
=
$this
->
updateDynamicContent
(
$content
,
$this
->
dynamicPlaceholders
);
}
}
echo
$content
;
echo
$content
;
...
@@ -133,12 +133,12 @@ class FragmentCache extends Widget
...
@@ -133,12 +133,12 @@ class FragmentCache extends Widget
if
(
is_array
(
$data
)
&&
count
(
$data
)
===
2
)
{
if
(
is_array
(
$data
)
&&
count
(
$data
)
===
2
)
{
list
(
$content
,
$placeholders
)
=
$data
;
list
(
$content
,
$placeholders
)
=
$data
;
if
(
is_array
(
$placeholders
)
&&
count
(
$placeholders
)
>
0
)
{
if
(
is_array
(
$placeholders
)
&&
count
(
$placeholders
)
>
0
)
{
if
(
empty
(
$this
->
view
->
cacheStack
))
{
if
(
empty
(
$this
->
getView
()
->
cacheStack
))
{
// outermost cache: replace placeholder with dynamic content
// outermost cache: replace placeholder with dynamic content
$content
=
$this
->
updateDynamicContent
(
$content
,
$placeholders
);
$content
=
$this
->
updateDynamicContent
(
$content
,
$placeholders
);
}
}
foreach
(
$placeholders
as
$name
=>
$statements
)
{
foreach
(
$placeholders
as
$name
=>
$statements
)
{
$this
->
view
->
addDynamicPlaceholder
(
$name
,
$statements
);
$this
->
getView
()
->
addDynamicPlaceholder
(
$name
,
$statements
);
}
}
}
}
$this
->
_content
=
$content
;
$this
->
_content
=
$content
;
...
@@ -151,7 +151,7 @@ class FragmentCache extends Widget
...
@@ -151,7 +151,7 @@ class FragmentCache extends Widget
protected
function
updateDynamicContent
(
$content
,
$placeholders
)
protected
function
updateDynamicContent
(
$content
,
$placeholders
)
{
{
foreach
(
$placeholders
as
$name
=>
$statements
)
{
foreach
(
$placeholders
as
$name
=>
$statements
)
{
$placeholders
[
$name
]
=
$this
->
view
->
evaluateDynamicContent
(
$statements
);
$placeholders
[
$name
]
=
$this
->
getView
()
->
evaluateDynamicContent
(
$statements
);
}
}
return
strtr
(
$content
,
$placeholders
);
return
strtr
(
$content
,
$placeholders
);
}
}
...
...
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