widgets\FragmentCache $dependency

$dependency public property

The dependency that the cached content depends on. This can be either a yii\caching\Dependency object or a configuration array for creating the dependency object. For example,

[
    'class' => 'yii\caching\DbDependency',
    'sql' => 'SELECT MAX(updated_at) FROM post',
]

would make the output cache depends on the last modified time of all posts. If any post has its modification time changed, the cached content would be invalidated.

doc_Yii
2016-10-30 17:18:18
Comments
Leave a Comment

Please login to continue.