2017 © Pedro Peláez
 

yii2-extension yii2-review

review for yii2 model

image

fgh151/yii2-review

review for yii2 model

  • Wednesday, February 1, 2017
  • by fgh151
  • Repository
  • 1 Watchers
  • 1 Stars
  • 28 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 8 % Grown

The README.md

Yii2-review

Module fo adding riview for yii2 model, (*1)

Installation

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

Either run, (*3)

php composer require fgh151/yii2-review "*"

or add, (*4)

"fgh151/yii2-review": "*",

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

Migrate up, (*6)

php yii migrate --migrationPath=vendor/fgh151/yii2-review/migrations

Once the extension is installed, simply add it in your config by : Basic config/web.php, (*7)

Advanced [backend|frontend|common]/config/main.php, (*8)

    'modules' => [
        'review' => [
            'class' => 'fgh151\review\Module',
        ],
        //...
    ]

RBAC

You can use RBAC with module. Simply add it in your config:, (*9)

>
        'modules'    => [
             'review' => [
                 'class' => 'fgh151\review\Module',
                 'as access' => [
                     'class' => 'yii\filters\AccessControl',
                     'rules' => [
                         [
                             'allow' => true,
                             'roles' => ['admin'],
                         ]
                     ]
                 ]
             ]
            ...
            ...
        ],

Usage

Add widgets to view five, (*10)



Review list:
=ReviewList::widget(['itemId' => $model->id, 'entity' => $model::className()]);?>

Review form:
=ReviewForm::widget(['model' => $model->id, 'entity' => $model::className()]);?>

Customize

You can override widgets views. Just add vie folder in widget. For example:, (*11)

=ReviewForm::widget([
    'modelId' => $model->id,
    'entity' => $model::className(),
    'viewFolder' => '@app/widgets/yii2-review/views'
]);?>

=ReviewList::widget([
    'itemId' => $model->id,
    'entity' => $model::className(),
    'viewFolder' => '@app/widgets/yii2-review/views'
]);?>

The Versions

01/02 2017

dev-master

9999999-dev https://github.com/fgh151/yii2-review

review for yii2 model

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

yii2 module yii 2 application review fgh151

01/02 2017

v0.0.3

0.0.3.0 https://github.com/fgh151/yii2-review

review for yii2 model

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

yii2 module yii 2 application review fgh151

01/02 2017

v0.0.2

0.0.2.0 https://github.com/fgh151/yii2-review

review for yii2 model

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

yii2 module yii 2 application review fgh151