widgets\FragmentCache updateDynamicContent()

updateDynamicContent() protected method Replaces placeholders in content by results of evaluated dynamic statements. protected string updateDynamicContent ( $content, $placeholders )$content string $placeholders array return string Final content

widgets\FragmentCache calculateKey()

calculateKey() protected method Generates a unique key used for storing the content in cache. The key generated depends on both $id and $variations. protected mixed calculateKey ( )return mixed A valid cache key

widgets\FragmentCache run()

run() public method Marks the end of content to be cached. Content displayed before this method call and after init() will be captured and saved in cache. This method does nothing if valid content is already found in cache. public void run ( )

widgets\FragmentCache getCachedContent()

getCachedContent() public method Returns the cached content if available. public string|false getCachedContent ( )return string|false The cached content. False is returned if valid content is not found in the cache.

widgets\FragmentCache $variations

$variations public property List of factors that would cause the variation of the content being cached. Each factor is a string representing a variation (e.g. the language, a GET parameter). The following variation setting will cause the content to be cached in different versions according to the current application language: [ Yii::$app->language, ] public array $variations = null

widgets\FragmentCache $dynamicPlaceholders

$dynamicPlaceholders public property A list of placeholders for embedding dynamic contents. This property is used internally to implement the content caching feature. Do not modify it. public array $dynamicPlaceholders = null

widgets\FragmentCache $duration

$duration public property Number of seconds that the data can remain valid in cache. Use 0 to indicate that the cached data will never expire. public integer $duration = 60

widgets\FragmentCache $enabled

$enabled public property Whether to enable the fragment cache. You may use this property to turn on and off the fragment cache according to specific setting (e.g. enable fragment cache only for GET requests). public boolean $enabled = true

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. public array|yii\cachin

widgets\FragmentCache $cache

$cache public property The cache object or the application component ID of the cache object. After the FragmentCache object is created, if you want to change this property, you should only assign it with a cache object. Starting from version 2.0.2, this can also be a configuration array for creating the object. public yii\caching\Cache|array|string $cache = 'cache'