bossit / yii2-favourite
Favourite component for Yii2
Installs: 933
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: ^7.0
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-12-23 00:26:58 UTC
README
Favourite component for Yii2.
Install
The preferred way to install this component is through composer.
$ composer require bossit/yii2-favourite:^1.0
Usage
The preferred way is to setup the components into our Application's configuration array:
'components' => [ 'favourite' => [ 'class' => \bossit\logger\FavouriteService::class, 'lifetime' => 31536000, 'cookieName' => 'favourite' ], ],
That's it, you are ready to use it as Yii2 components.
Examples:
// add to favourite \Yii::$app->favourite->add($productId); // remove from favourite \Yii::$app->favourite->remove($productId); // get items of favourite \Yii::$app->favourite->getItems();