控制器: //页面静态化(缓存) public function behaviors() { return [ [ ‘class‘ => ‘yii\filters\PageCache‘, ‘only‘ => [‘list‘], ‘duration‘ => 60, ‘variations‘ => [ \Yii::$app->language, ], ‘dependency‘ => [ ‘class‘ => ‘yii\caching\DbDependency‘, ‘sql‘ => ‘SELECT COUNT(*) FROM yong‘, ], ], ]; }
时间: 2024-10-19 21:04:56