ws-cv-ua/ws-referral-link

This package for hiding original link and show info about following

1.0.0 2017-09-01 15:43 UTC

This package is auto-updated.

Last update: 2024-05-10 04:27:06 UTC


README

  1. Run command
composer require ws-cv-ua/ws-referral-link
  1. Run migration
yii migrate --migrationPath=@vendor/ws-cv-ua/ws-referral-link/migrations
  1. Set referral action in frontend controller. For example:
...
public function actions()
{
    return [
        ...
        'referral' => [
            'class' => '\wscvua\ws_referral_link\actions\ReferralAction',
        ],
        ...
    ];
}
...
  1. 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

  1. 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