sjaakp/yii2-cookieconsent

Osano Cookie Consent plugin for the Yii 2.0 framework

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.0 2019-12-05 13:45 UTC

This package is auto-updated.

Last update: 2024-11-06 07:10:48 UTC


README

Wrapper for Osano Cookie Consent plugin

Latest Stable Version Total Downloads License

This is a simple wrapper for the Osano Cookie Consent plugin to be used in the Yii 2.0 PHP Framework.

Usage

sjaakp\cookieconstent\CookieConsent is a Yii2 Widget which can be used in a layout view file along these lines:

<?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 options are documented here.