aminkt / yii2-appcache
Yii2 appcache component to enable app cache in site.
Installs: 834
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: >=2.0.11
This package is auto-updated.
Last update: 2024-10-13 23:11:21 UTC
README
Add flowing line into your composer.json
files.
"aminkt/yii2-appcache" : "@dev"
How use widget?
Add flowing lines into your controller class.
= public function behaviors() { return [ 'appcache' => [ 'class' => AppCacheFilter::className(), 'actions' => ['index', 'view'] ], ]; }
In action part of configuration add actions that you want create an manifest file for it.
Then add flowing line into your main.php
of your layout.
<?php $appCache = \aminkt\components\appcache\AppCacheFilter::getManifestFileUrl($this); ?> <?php $this->beginPage() ?> <!DOCTYPE html> <html <?= $appCache ? "manifest=\"$appCache\"" : '' ?> >