bossit / yii2-favourite
There is no license information available for the latest version (1.0.2) of this package.
Favourite component for Yii2
Package info
github.com/bossit/yii2-favourite
Type:yii2-extension
pkg:composer/bossit/yii2-favourite
1.0.2
2019-02-22 09:46 UTC
Requires
- php: ^7.0
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2026-03-23 03:31:25 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();