sjaakp/yii2-cookieconsent

为 Yii 2.0 框架提供的 Osano Cookie Consent 插件

安装次数: 14

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:yii2-extension

1.0.0 2019-12-05 13:45 UTC

This package is auto-updated.

Last update: 2024-09-06 06:48:15 UTC


README

Osano Cookie Consent 插件的包装器

Latest Stable Version Total Downloads License

这是一个用于 Osano Cookie Consent 插件 的简单包装器,可在 Yii 2.0 PHP 框架中使用。

使用方法

sjaakp\cookieconstent\CookieConsent 是一个 Yii2 Widget,可以在布局视图文件中使用,如下所示

<?php
use sjaakp\cookieconsent\CookieConsent;
?>

<?php $this->beginPage() ?>
<!DOCTYPE html>
<html ...>
<head>
    ... 
    <?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>
    ...
    <?= $content ?>
    ...
<?php $this->endBody() ?>

<?= CookieConsent::widget([
    'options' => [
        'content' => [
            'message' => 'This website uses cookies...',
            // ... more content options ...
        ]
        // ... more cookieconsent options ...
    ]
]) ?>

</body>
</html>
<?php $this->endPage() ?>

CookieConsent 选项的文档在此