2017 © Pedro Peláez
 

yii2-extension yii2-vote

Provides anonymous voting for any models

image

dsergey/yii2-vote

Provides anonymous voting for any models

  • Monday, November 7, 2016
  • by dsergey
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 28 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

Vote for Yii2

Latest Stable Version Total Downloads Build Status Test Coverage Code Climate 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 "^3.0"

or add, (*5)

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

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',
        // 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)

License

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

List of contributors

How to contribute

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

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

The Versions

07/11 2016

dev-master

9999999-dev

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