This method will display cached content if it is available.
If not, it will start caching and would expect an View::endCache
call to end the cache and save the content into cache.
A typical usage of fragment caching is as follows,
php
if ($this->beginCache($id)) {
...generate content here
$this->endCache();
}
public beginCache ( string $id, array $properties = [] ) : boolean | ||
$id | string | a unique ID identifying the fragment to be cached. |
$properties | array | initial property values for [[FragmentCache]] |
return | boolean | whether you should generate the content for caching. False if the cached version is available. |