2017 © Pedro Peláez
 

yii2-extension yii2-reviews

Reviews for YII2

image

hrupin/yii2-reviews

Reviews for YII2

  • Thursday, March 15, 2018
  • by hrupin
  • Repository
  • 1 Watchers
  • 1 Stars
  • 78 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 48 Versions
  • 10 % Grown

The README.md

Reviews for YII2

Module Reviews for YII2, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Need RBAC, (*3)

Either run, (*4)

php composer.phar require --prefer-dist hrupin/yii2-reviews "*"

or add, (*5)

"hrupin/yii2-reviews": "*"

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

configure

in common/config/main.php, (*7)

'modules' => [
        'reviews' => [
            'class' => 'hrupin\reviews\Module',
            'userModel' => 'common\models\User',
            'modelMap' => [
                'Reviews' => 'common\models\Reviews',
            ],
            'controllerMap' => [
                'admin' => 'backend\controllers\ReviewsController',
                'reviews' => 'frontend\controllers\ReviewsController'
            ],
            'moderateReviews' => false,
            'ratingStars' => [
                1 => 'Ужасно',
                2 => 'Плохо',
                3 => 'Нормально',
                4 => 'Хорошо',
                5 => 'Отлично'
            ],
            'customOptions' => [
                'Company' => [
                    [
                        'type'  => 'radioList',
                        'statistic' => [
                            'bad' => ['1'],
                            'good' => ['3'],
                        ],
                        'data'  => ['3' => 'Да', '1' => 'Нет', '2' => 'Не помню'],
                        'label' => 'Цены и наличие были указаны верно?',
                        'answer' => [
                            1 => 'Цена и наличие не соответствовали',
                            2 => 'Не помню',
                            3 => 'Цена и наличие были указаны верно'
                        ]
                    ],
                    [
                        'type'  => 'radioList',
                        'statistic' => [
                            'bad' => ['1'],
                            'good' => ['3'],
                        ],
                        'data'  => ['3' => 'Да', '1' => 'Нет', '2' => 'Не помню'],
                        'label' => 'Заказ был вополнен в оговоренные сроки?',
                        'answer' => [
                            1 => 'При выполнении заказа была задержка',
                            2 => 'Не помню',
                            3 => 'Заказ был вополнен в оговоренные сроки'
                        ]
                    ],
                    [
                        'type'   => 'dropDownList',
                        'statistic' => [
                            'bad' => ['1','2','3','4','5'],
                            'good' => ['6'],
                        ],
                        'data'   => [
                            '6'=>'В течение 30 минут',
                            '5' => 'В течение двух часов',
                            '4' => 'В течение дня',
                            '3' => 'На следующий день',
                            '2' => 'Не связались',
                            '1' => 'Я звонил сам',
                        ],
                        'params' => ['prompt' => 'Как быстро с вами связались после заказа?'],
                        'label' => 'Как быстро с вами связались после заказа?',
                        'answer' => [
                            1 => 'Я звонил сам',
                            2 => 'Не связались',
                            3 => 'На следующий день',
                            4 => 'В течение дня',
                            5 => 'В течение двух часов',
                            6 =>'В течение 30 минут',
                        ]
                    ]
                ],
                'User' => [
                    [
                        'type'  => 'radioList',
                        'data'  => ['3' => 'Да', '1' => 'Нет', '2' => 'Не помню'],
                        'label' => 'Соответствовал ли товар описанию и состоянию указаные в описании продавца?',
                        'answer' => [
                            1 => 'Описание товара не соответствовало',
                            2 => 'Не помню',
                            3 => 'Описание товара полностью соответствовали'
                        ]
                    ],
                    [
                        'type'  => 'radioList',
                        'data'  => ['3' => 'Да', '1' => 'Нет', '2' => 'Не помню'],
                        'label' => 'Возникали сложности с оплатой и получением?',
                        'answer' => [
                            1 => 'Были сложности с оплатой и получением',
                            2 => 'Не помню',
                            3 => 'Сложности при оплате и получении не возникли'
                        ]
                    ],
                    [
                        'type'  => 'radioList',
                        'data'  => ['3' => 'Да', '1' => 'Нет', '2' => 'Не уверен'],
                        'label' => 'Рекомендуете ли Вы продавца?',
                        'answer' => [
                            1 => 'Рекомендую',
                            2 => 'Воздержусь',
                            3 => 'Не рекомендую'
                        ]
                    ]
                ],
                'Project' => []
            ]
        ],

in frontend/config/main.php, (*8)

'modules' => [
    'reviews' => [
        'as frontend' => 'hrupin\reviews\filters\FrontendFilter',
    ],
]

in backend/config/main.php, (*9)

'modules' => [
    'reviews' => [
        'as backend' => 'hrupin\reviews\filters\BackendFilter',
    ],
],

add to model User, (*10)

    public function getPublicAvatar()
    {
        // your code
    }

    public function getPublicName()
    {
        // your code
    }

    public function getSendEmail()
    {
        // your code
        // return true or false
    }

migrate

 php yii migrate/up --migrationPath=@vendor/hrupin/yii2-reviews/migrations
 ```

delete

php yii migrate/down --migrationPath=@vendor/hrupin/yii2-reviews/migrations, (*11)


Usage ----- Once the extension is installed, simply use it in your code by : MINIMUM

= hrupin\reviews\widgets\Reviews::widget([ 'pageIdentifier' => 'p_11' ]); ?>, (*12)


FULL

= hrupin\reviews\widgets\Reviews::widget([ 'reviewsIdentifier' => 'categoryId', 'pageIdentifier' => 'p_11', 'reviewsView' => '/ad/reviews', 'enableReviews' => true, 'emailAuthor' => 'info@yandex.ru' ]); ?>, (*13)


AND
= \hrupin\reviews\widgets\ReviewsModal::widget([ 'pageIdentifier' => 'index' ]); ?>= hrupin\reviews\widgets\ReviewsStatistics::widget([ 'pageIdentifier' => ['index', 'index-2'], 'reviewsIdentifier' => 'index', 'statisticsReviews' => [ ['name' => 'Отрицательные', 'check' => 2], // 1 and 2 stars ['name' => 'Нейтральные', 'check' => 3], // 3 stars ['name' => 'Положительные', 'check' => 5] // 4 and 5 stars ], 'timePeriod' => [ 'type' => 'month', // day, month, year 'period' => [1, 3, 6], 'name' => ['месяц', 'месяца', 'месяцев'] ] ]); ?>= \hrupin\reviews\widgets\CustomerRating::widget([ 'pageIdentifier' => ['index'], 'reviewsIdentifier' => 'reviews', ]); ?>= \hrupin\reviews\widgets\ReviewsList::widget([ 'pageIdentifier' => ['index'], ]); ?>

```, (*14)

The Versions

15/03 2018

dev-master

9999999-dev

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

15/03 2018

0.7.2

0.7.2.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

14/03 2018

0.7.0

0.7.0.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

14/03 2018

0.7.1

0.7.1.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

24/12 2017

0.6.1

0.6.1.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

27/10 2017

0.6.0

0.6.0.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

20/10 2017

0.5.15

0.5.15.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

19/10 2017

0.5.14

0.5.14.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

19/10 2017

0.5.13

0.5.13.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

19/10 2017

0.5.12

0.5.12.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

18/10 2017

0.5.11

0.5.11.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

17/10 2017

0.5.10

0.5.10.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

17/10 2017

0.5.9

0.5.9.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

16/10 2017

0.5.8

0.5.8.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

12/10 2017

0.5.7

0.5.7.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

12/10 2017

0.5.6

0.5.6.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

11/10 2017

0.5.5

0.5.5.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

10/10 2017

0.5.4

0.5.4.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

05/10 2017

0.5.3

0.5.3.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

05/10 2017

0.5.2

0.5.2.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

05/10 2017

0.5.1

0.5.1.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

05/10 2017

0.5.0

0.5.0.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

04/10 2017

0.4.4

0.4.4.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

03/10 2017

0.4.3

0.4.3.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

02/10 2017

0.4.2

0.4.2.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

02/10 2017

0.4.1

0.4.1.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

30/09 2017

0.4.0

0.4.0.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

28/09 2017

0.3.4

0.3.4.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

26/09 2017

0.3.3

0.3.3.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

21/09 2017

0.3.2

0.3.2.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

21/09 2017

0.3.1

0.3.1.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

21/09 2017

0.3.0

0.3.0.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

21/09 2017

0.2.5

0.2.5.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

21/09 2017

0.2.4

0.2.4.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

21/09 2017

0.2.3

0.2.3.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

18/09 2017

0.2.2

0.2.2.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

17/09 2017

0.2.1

0.2.1.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

17/09 2017

0.2.0

0.2.0.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

12/09 2017

0.1.5

0.1.5.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

10/09 2017

0.1.4

0.1.4.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

05/09 2017

0.1.3

0.1.3.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

05/09 2017

0.1.2

0.1.2.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

03/09 2017

0.1.1

0.1.1.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

29/08 2017

0.1.0

0.1.0.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

25/08 2017

0.0.4

0.0.4.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

22/08 2017

0.0.3

0.0.3.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

22/08 2017

0.0.1

0.0.1.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2

22/08 2017

0.0.2

0.0.2.0

Reviews for YII2

  Sources   Download

Apache-2.0

The Requires

 

by Hrupin Aleksandr

extension yii2