File tree Expand file tree Collapse file tree 1 file changed +10
-19
lines changed
Expand file tree Collapse file tree 1 file changed +10
-19
lines changed Original file line number Diff line number Diff line change 55use nullref \cms \models \Page ;
66use Yii ;
77use yii \base \Action ;
8- use yii \caching \Cache ;
98use yii \web \NotFoundHttpException ;
109
1110
1615class PageView extends Action
1716{
1817 public $ view = 'view ' ;
19-
20- public $ cachePrefix = 'cms.page. ' ;
21-
18+
2219 public function run ()
2320 {
2421 if (($ route = Yii::$ app ->request ->getQueryParam ('route ' )) == null ) {
@@ -32,22 +29,16 @@ public function run()
3229 throw new NotFoundHttpException (Yii::t ('cms ' , 'Page not found. ' ));
3330 }
3431
35- /** @var Cache $cache */
36- $ cache = Yii::$ app ->getCache ();
37-
38- if (($ result = $ cache ->get ($ this ->cachePrefix . $ route )) === false ) {
39- if ($ page ->layout ) {
40- $ this ->controller ->layout = $ page ->layout ;
41- }
42- if ($ page ->type == Page::TYPE_CONTENT ) {
43- $ this ->view = 'content-view ' ;
44- }
45- $ result = $ this ->controller ->render ($ this ->view , [
46- 'page ' => $ page ,
47- ]);
48- $ cache ->set ($ this ->cachePrefix . $ route , $ result );
32+ if ($ page ->layout ) {
33+ $ this ->controller ->layout = $ page ->layout ;
34+ }
35+ if ($ page ->type == Page::TYPE_CONTENT ) {
36+ $ this ->view = 'content-view ' ;
4937 }
38+ $ result = $ this ->controller ->render ($ this ->view , [
39+ 'page ' => $ page ,
40+ ]);
5041
5142 return $ result ;
5243 }
53- }
44+ }
You can’t perform that action at this time.
0 commit comments