定制 vova07/yii2-start-comments-module 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

vova07/yii2-start-comments-module

最新稳定版本:0.1.4

Composer 安装命令:

composer require vova07/yii2-start-comments-module

包简介

The comments module for Yii2-Start application.

README 文档

README

Yii2-Start comments module.

This module provide a comments managing system for Yii2-Start application.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist vova07/yii2-start-comments-module "*"

or add

"vova07/yii2-start-comments-module": "*"

to the require section of your composer.json file.

Configuration

  • Add module to config section:
'modules' => [
    'comments' => [
        'class' => 'vova07\comments\Module'
    ]
]
  • Run migrations:
php yii migrate --migrationPath=@vova07/comments/migrations
  • Run RBAC command:
php yii comments/rbac/add

Usage:

  • Add a new comment-on-able model namespace in yii2-start.domain/backend/comments/models/index/
  • Add Comments widget in your view file:
echo \vova07\comments\widgets\Comments::widget(  
    [  
        'model' => $model,  
        'jsOptions' => [  
            'listSelector' => '[data-comment="list"]', // Comment list selector 
            'parentSelector' => '[data-comment="parent"]', // Comment parent selector
            'appendSelector' => '[data-comment="append"]', // Container selector where "reply" and "edit" form will be appended by jQuery
            'formSelector' => '[data-comment="form"]', // Comment form selector
            'contentSelector' => '[data-comment="content"]', // Comment content selector
            'toolsSelector' => '[data-comment="tools"]', // Comment tools selector
            'formGroupSelector' => '[data-comment="form-group"]', // Comment form group selector
            'errorSummarySelector' => '[data-comment="form-summary"]', // Comment form summary error selector
            'errorSummaryToggleClass' => 'hidden', // Comment summary error class that will be add/remove by jQuery on error reporting
            'errorClass' => 'has-error', // Comment form group error class
            'offset' => 0 // Top offset for scrollTo function. Use it if you have fixed top menu for correct scrolling to comment's parent. In case with fixed menu, "offset" value must be equal with menu block height.
        ]  
    ]  
);
  • Profit!

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 5
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-10-12