2017 © Pedro Peláez
 

yii2-extension eg-follow

yii2 follow module

image

elephantsgroup/eg-follow

yii2 follow module

  • Friday, June 8, 2018
  • by ElephantsGroup
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 100 % Grown

The README.md

To use Elephants Group follow module first you must install module, then you can use follow widget anywhere in your website., (*1)

Installation Steps:

1) run, (*2)

php composer.phar require elephantsgroup/eg-follow "*", (*3)

or add "elephantsgroup/eg-follow": "*" to the require section of your composer.json file., (*4)

2) migrate database, (*5)

yii migrate --migrationPath=vendor/elephantsgroup/eg-follow/migrations, (*6)

3) add follow module to common configuration (common/config.php file), (*7)

'modules' => [ ... 'follow' => [ 'class' => 'elephantsGroup\follow\Module', ], ... ], (*8)

4) open access to module in common configuration, (*9)

'as access' => [ 'class' => 'mdm\admin\components\AccessControl', 'allowActions' => [ ... 'follow/ajax/*', ... ] ], (*10)

5) filter admin controller in frontend configuration (frontend/config.php file), (*11)

'modules' => [ ... 'follow' => [ 'as frontend' => 'elephantsGroup\follow\filters\FrontendFilter', ], ... ], (*12)

5) filter ajax controller in backend configuration (backend/config.php file), (*13)

'modules' => [ ... 'follow' => [ 'as backend' => 'elephantsGroup\follow\filters\BackendFilter', ], ... ], (*14)

Using follow widget

Anywhere in your code you can use follow widget as follows: <?= Follows::widget() ?>, (*15)

You need to use Follows widget header in your page: use elephantsGroup\follow\components\Follows;, (*16)

Follow widget parameters

  • item (integer): to separate follows between different items. <?= Follows::widget(['item' => 1]) ?> <?= Follows::widget(['item' => $model->id]) ?>

default value for item is 0 - service (integer): to separate follows between various item types. <?= Folloes::widget(['service' => 1, 'item' => $model->id]) ?>, (*17)

for example you can use different values for different modules in your app, and then use follow widget separately in modules. default value for service is 0 - color (string): color of unfollowed icon heart, default 'black' <?= Follows::widget(['service' => 1, ''item' => $model->id, 'color' => 'yellow']) ?>, (*18)

  • view_file (string): the view file path for rendering

<?= Follows::widget([ 'service' => 1, 'item' => $model->id, 'color' => 'yellow', 'view_file' => Yii::getAlias('@frontend') . '/views/follow/widget.php' ]) ?>, (*19)

you can use these variables in your customized view: * service * item * color * is_follow, (*20)

The Versions

08/06 2018

dev-master

9999999-dev

yii2 follow module

  Sources   Download

MIT

The Requires

 

by Jalal Jaberi
by Arezou Zahedi Majd

extension yii2 yii follow elephantsgroup

20/05 2018

1.0.0

1.0.0.0

yii2 follow module

  Sources   Download

MIT

The Requires

 

by Jalal Jaberi
by Arezou Zahedi Majd

extension yii2 yii follow elephantsgroup