2017 © Pedro Peláez
 

yii2-extension yii2-vote

Provides anonymous voting for any models

image

chiliec/yii2-vote

Provides anonymous voting for any models

  • Sunday, June 10, 2018
  • by Chiliec
  • Repository
  • 11 Watchers
  • 64 Stars
  • 2,864 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 28 Forks
  • 5 Open issues
  • 15 Versions
  • 3 % Grown

The README.md

Vote for Yii2

Latest Stable Version Total Downloads Build Status Code Climate Test Coverage License, (*1)

How yii2-vote works, (*2)

Installation

Next steps will guide you through the process of installing yii2-vote using composer. Installation is a quick and easy three-step process., (*3)

Step 1: Install component via composer

Run command, (*4)

php composer.phar require --prefer-dist chiliec/yii2-vote "^4.2"

or add, (*5)

"chiliec/yii2-vote": "^4.2"

to the require section of your composer.json file., (*6)

Step 2: Configuring your application

Add following lines to your main configuration file:, (*7)

'bootstrap' => [
    'chiliec\vote\components\VoteBootstrap',
],
'modules' => [
    'vote' => [
        'class' => 'chiliec\vote\Module',
        // show messages in popover
        'popOverEnabled' => true,
        // global values for all models
        // 'allowGuests' => true,
        // 'allowChangeVote' => true,
        'models' => [
            // example declaration of models
            // \common\models\Post::className(),
            // 'backend\models\Post',
            // 2 => 'frontend\models\Story',
            // 3 => [
            //     'modelName' => \backend\models\Mail::className(),
            //     you can rewrite global values for specific model
            //     'allowGuests' => false,
            //     'allowChangeVote' => false,
            // ],
        ],      
    ],
],

And add widget in view:, (*8)

<?php echo \chiliec\vote\widgets\Vote::widget([
    'model' => $model,
    // optional fields
    // 'showAggregateRating' => true,
]); ?>

Also you can add widget for display top rated models:, (*9)

<?php echo \chiliec\vote\widgets\TopRated::widget([
    'modelName' => \common\models\Post::className(),
    'title' => 'Top rated models',
    'path' => 'site/view',
    'limit' => 10,
    'titleField' => 'title',
]) ?>

Step 3: Updating database schema

After you downloaded and configured Yii2-vote, the last thing you need to do is updating your database schema by applying the migrations:, (*10)

$ php yii migrate/up --migrationPath=@vendor/chiliec/yii2-vote/migrations

Documentation

Extended information about configuration of this module see in docs/README.md. There you can find: * Migration from 2.* to 3.0 * Manually add behavior in models * Sorting by rating in data provider * Overriding views * Customizing JS-events * Rich snippet in search engines, (*11)

List of contributors

Other vote solutions for Yii2

Articles and tutorials

Usage examples

  • Your site could be the first in this list

License

yii2-vote is released under the BSD 3-Clause License. See the bundled LICENSE.md for details., (*12)

How to contribute

See CONTRIBUTING.md for details., (*13)

Enjoy and don't hesitate to send issues and pull requests :), (*14)

The Versions

10/06 2018

dev-master

9999999-dev

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

anonymous voting vote

19/05 2018

4.2

4.2.0.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

anonymous voting vote

09/09 2017

4.1

4.1.0.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

anonymous voting vote

27/11 2016

4.0.0

4.0.0.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

anonymous voting vote

17/03 2016

3.0.1

3.0.1.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

anonymous voting vote

13/03 2016

3.0

3.0.0.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

anonymous voting vote

28/11 2015

2.0.3

2.0.3.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

anonymous voting vote

03/06 2015

2.0.2

2.0.2.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

anonymous voting vote

15/02 2015

2.0.1

2.0.1.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

anonymous voting vote

30/01 2015

2.0

2.0.0.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

anonymous voting vote

25/01 2015

1.4

1.4.0.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

anonymous voting vote

19/01 2015

1.3

1.3.0.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

anonymous voting vote

19/01 2015

1.2

1.2.0.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

anonymous voting vote

03/01 2015

1.1

1.1.0.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

anonymous voting vote

02/01 2015

1.0

1.0.0.0

Provides anonymous voting for any models

  Sources   Download

BSD-3-Clause

The Requires

 

anonymous voting vote