aminkt/yii2-appcache

There is no license information available for the latest version (dev-master) of this package.

Yii2 appcache component to enable app cache in site.

Installs: 34

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2018-12-13 23:48 UTC

This package is auto-updated.

Last update: 2020-07-13 14:30:56 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\"" : '' ?> >