2017 © Pedro PelĂĄez
 

yii2-extension yii2-thumbs-up

Thumbs up rating module for Yii 2

image

godzie44/yii2-thumbs-up

Thumbs up rating module for Yii 2

  • Thursday, June 9, 2016
  • by godzie44
  • Repository
  • 1 Watchers
  • 2 Stars
  • 40 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 4 Versions
  • 3 % Grown

The README.md

yii2-thumbs-up

Thumbs up rating yii2 module (used ajax)., (*1)

Installation

composer require godzie44/yii2-thumbs-up

Configuration

In config /protected/config/main.php, (*2)

<?php
return [
    // ...
    'modules' => [
      /* other modules */

        'thumbsup' => [
            'class' => 'godzie44\yii\module\thumbsup\Module',
                  'useRbac' => true, 
                  ]
    ],
    // ...
];

In auth manager add rules (if Module::$useRbac = true):, (*3)

<?php
use godzie44\yii\module\thumbsup;

$thumbsUpChange = new \yii\rbac\Permission([
            'name' => thumbsup\Permission::CHANGE,
            'description' => 'Can change thumb state',
        ]);
$authManager->add($thumbsUpChange);

Updating database schema

After you downloaded and configured, updating your database schema by applying the migrations:, (*4)

In command line:, (*5)

php yii migrate/up --migrationPath=@vendor/godzie44/yii2-thumbs-up/migrations/

Usage

In controller, (*6)


public function actions() { return [ 'thumb-rate' => [ 'class' => 'godzie44\yii\module\thumbsup\ThumbRateAction' ], /* other actions */ ]; }

In view, (*7)

<?php
// ...

use godzie44\yii\module\thumbsup;

echo thumbsup\widgets\ThumbsUpWidget::widget(['entity' => "entity-44"]);

Parameters

 Module parameters

  • useRbac (optional, boolean) Default TRUE. Defines if the rating system will use Rbac validation to check permissions when trying to rate some entity.

Widget parameters

  • entity (required, string) The identify of rating.
  • tooltip (optional, array) Define this array to use custom tooltip labels.

The Versions

09/06 2016

dev-master

9999999-dev

Thumbs up rating module for Yii 2

  Sources   Download

MIT

The Requires

 

by Derevtsov Konstantin

module yii widget thumbs-up

31/05 2016

v1.1.0

1.1.0.0

Thumbs up rating module for Yii 2

  Sources   Download

MIT

The Requires

 

by Derevtsov Konstantin

module yii widget thumbs-up

16/05 2016

v1.0.1

1.0.1.0

Thumbs up rating module for Yii 2

  Sources   Download

MIT

The Requires

 

by Derevtsov Konstantin

module yii widget thumbs-up

14/05 2016

v1.0.0

1.0.0.0

Thumbs up rating module for Yii 2

  Sources   Download

MIT

The Requires

 

by Derevtsov Konstantin

module yii widget thumbs-up