base\View beginCache()

beginCache() public method

Begins fragment caching.

This method will display cached content if it is available. If not, it will start caching and would expect an endCache() call to end the cache and save the content into cache. A typical usage of fragment caching is as follows,

if ($this->beginCache($id)) {
    // ...generate content here
    $this->endCache();
}
public boolean beginCache ( $id, $properties = [] )
$id string

A unique ID identifying the fragment to be cached.

$properties array

Initial property values for yii\widgets\FragmentCache

return boolean

Whether you should generate the content for caching. False if the cached version is available.

doc_Yii
2016-10-30 16:52:31
Comments
Leave a Comment

Please login to continue.