fgh151/yii2-review 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fgh151/yii2-review

Composer 安装命令:

composer require fgh151/yii2-review

包简介

review for yii2 model

README 文档

README

Module fo adding riview for yii2 model

Installation

The preferred way to install this extension is through composer.

Either run

php composer require fgh151/yii2-review "*"

or add

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

to the require section of your composer.json file.

Migrate up

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

Advanced [backend|frontend|common]/config/main.php

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

RBAC

You can use RBAC with module. Simply add it in your config:

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

Usage

Add widgets to view five

<?php
use fgh151\review\widgets\ReviewList;
use fgh151\review\widgets\ReviewForm;
?>

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:

<?=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'
]);?>

统计信息

  • 总下载量: 127
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2017-02-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固