public function onRegister()
    {
        if ($this->isCachingEnabled()) {
            $phpBlockView = $this->getView();
    
            $blockId = $this->getEnvOption('id');
    
            $cacheKeyAssets = ['blockassets', $blockId];
            $cacheKeyAssetBundles = ['blockassetbundles', $blockId];
            
            $assets = Yii::$app->cache->getOrSet($cacheKeyAssets, [$phpBlockView, 'getBlockAssets'], $this->getCacheExpirationTime());
            $assetBundles = Yii::$app->cache->getOrSet($cacheKeyAssetBundles, [$phpBlockView, 'getAssetBundleNames'], $this->getCacheExpirationTime());
    
            /**
             * @todo i think this is not need because in PhpBlockView::init() the EVENT_AFTER_RENDER is listen also.
             */
            PhpBlockView::registerToAppView($assets, $assetBundles);
        }
    }
public function onRegister()
    {
        if ($this->isCachingEnabled()) {
            $phpBlockView = $this->getView();
    
            $blockId = $this->getEnvOption('id');
    
            $cacheKeyAssets = ['blockassets', $blockId];
            $cacheKeyAssetBundles = ['blockassetbundles', $blockId];
            
            $assets = Yii::$app->cache->getOrSet($cacheKeyAssets, [$phpBlockView, 'getBlockAssets'], $this->getCacheExpirationTime());
            $assetBundles = Yii::$app->cache->getOrSet($cacheKeyAssetBundles, [$phpBlockView, 'getAssetBundleNames'], $this->getCacheExpirationTime());
    
            /**
             * @todo i think this is not need because in PhpBlockView::init() the EVENT_AFTER_RENDER is listen also.
             */
            PhpBlockView::registerToAppView($assets, $assetBundles);
        }
    }
public function onRegister ( ) { if ( $ this -> isCachingEnabled ( ) ) { $ phpBlockView = $ this -> getView ( ) ; $ blockId = $ this -> getEnvOption ( 'id' ) ; $ cacheKeyAssets = [ 'blockassets' , $ blockId ] ; $ cacheKeyAssetBundles = [ 'blockassetbundles' , $ blockId ] ; $ assets = Yii :: $ app -> cache -> getOrSet ( $ cacheKeyAssets , [ $ phpBlockView , 'getBlockAssets' ] , $ this -> getCacheExpirationTime ( ) ) ; $ assetBundles = Yii :: $ app -> cache -> getOrSet ( $ cacheKeyAssetBundles , [ $ phpBlockView , 'getAssetBundleNames' ] , $ this -> getCacheExpirationTime ( ) ) ; /**
             * @todo i think this is not need because in PhpBlockView::init() the EVENT_AFTER_RENDER is listen also.
             */ PhpBlockView :: registerToAppView ( $ assets , $ assetBundles ) ; } }
Save the registered assets form block to the cache.

@since 1.0.5
Save the registered assets form block to the cache .