- Run command
composer require ws-cv-ua/ws-referral-link
- Run migration
yii migrate --migrationPath=@vendor/ws-cv-ua/ws-referral-link/migrations
- Set referral action in frontend controller. For example:
...
public function actions()
{
return [
...
'referral' => [
'class' => '\wscvua\ws_referral_link\actions\ReferralAction',
],
...
];
}
...
- Set referral module in admin (backend) part of application. For example:
...
'modules' => [
'referral' => [
'class' => \wscvua\ws_referral_link\Module::className(),
'adminPermission' => ['admin']
],
...
],
...
adminPermission is needle permission for access module
- Referral widget example:
use wscvua\ws_referral_link\widgets\ReferralLink;
ReferralLink::widget([
'url' => $url,
'controller' => 'site'
]);
If controller field not set, then it will be have value of current controller