asgalex / yii2-evercookie
Simple evercookie component and widget for Yii2
Installs: 4 433
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 2
Open Issues: 0
Type:yii2-extension
Requires
- lagman/evercookie: dev-master
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-11-17 06:02:11 UTC
README
Simple evercookie component and widget for Yii2
Quick start
- Add to composer.json:
"require": {
"asgalex/yii2-evercookie": "dev-master"
}
- Add component to your project's web config:
$config = [
'components' => [
'evercookie' => [
'class' => 'asgalex\evercookie\EverCookie',
]
];
- Add Evercookie widget to pages with evercookie functionality:
<?= EverCookieWidget::widget(); ?>
- Now, you have the "evercookie" object in your javascript code!
Configuration
You can configure the evercookie object using component settings. All settings are same as for javascript evercookie object. Example:
$config = [
'components' => [
'evercookie' => [
'class' => 'asgalex\evercookie\EverCookie',
'java' => false,
'silverlight' => false,
]
];
All settings will be converted to JSON and passed to javascript evercookie object as options.