PHPackages                             slinstj/yii2-simple-feedback - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. slinstj/yii2-simple-feedback

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

slinstj/yii2-simple-feedback
============================

Rating and comment feedback system that works out of the box for Yii2.

v1.0(7y ago)228[2 issues](https://github.com/sdlins/yii2-simple-feedback/issues)MITPHPPHP ~7.1

Since Jun 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sdlins/yii2-simple-feedback)[ Packagist](https://packagist.org/packages/slinstj/yii2-simple-feedback)[ Docs](https://github.com/slinstj/yii2-simple-feedback)[ RSS](/packages/slinstj-yii2-simple-feedback/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Yii2 Simple Feedback
====================

[](#yii2-simple-feedback)

Rating and comment feedback system that works out of the box for Yii2.

[![Yii2 Simple Feedback Basic Demo](simple-feedback-basic-demo-xs.png)](simple-feedback-basic-demo-xs.png)

Installation
------------

[](#installation)

```
composer require "slinstj/yii2-simple-feedback:~1.0"
```

The most simple way to use
--------------------------

[](#the-most-simple-way-to-use)

*This way will use default configs*.

1 - Put the Simple Feedback Widget in your view:

```
// in myview.php
use \slinstj\widgets\SimpleFeedback\SimpleFeedbackWidget;
?>
// put it wherever you preffer in your view:

```

2 - Config the action to save the feedback data:

```
// SiteController
...
public function actions()
{
    return [
        'rating' => [
            'class' => 'slinstj\widgets\SimpleFeedback\actions\RatingAction',
        ],
    ];
}
```

3 - Run migration to create the table where ratings will be saved:

```
# in your root directory, run:
php yii migrate --migrationPath=@vendor/slinstj/yii2-simple-feedback/src/migrations
```

**And it is done!**

After the user do the rate, a success or danger alert will be displayed in substitution to the widget:

[![Yii2 Simple Feedback Success Response](simple-feedback-success-response.png)](simple-feedback-success-response.png)

Supported languages
-------------------

[](#supported-languages)

Brazillian Portuguese and English.

Advanced Usage
--------------

[](#advanced-usage)

You can change almost all default configs. These are some configs you can change:

- DB config name;
- Table and fields names;
- Labels used for rating and comment attributes;
- Rules used for the form model;
- Route that will receive the post form data;
- The target value identifying what is being rated. You can use either a string or a callback function;

### How change the default configs

[](#how-change-the-default-configs)

Just pass the configs when calling the widget:

```
// IMPORTANT:
// Please, refer to public attributes docblocks either in SimpleFeedbackWidget
// and SimpleFeedbackModel to see all available options.
