2017 © Pedro Peláez
 

yii2-extension yii2-comments-module

The comments module for Yii2 application.

image

stepancher/yii2-comments-module

The comments module for Yii2 application.

  • Friday, May 20, 2016
  • by stepancher
  • Repository
  • 4 Watchers
  • 1 Stars
  • 461 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 15 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Yii2-Start comments module.

This module provide a comments managing system for Yii2-Start application., (*1)

Installation

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

Either run, (*3)

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

or add, (*4)

"stepancher/yii2-comments-module": "*"

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

Configuration

  • Add module to config section:
'modules' => [
    'comments' => [
        'class' => 'stepancher\comments\Module'
    ]
]
  • Run migrations:
php yii migrate --migrationPath=@stepancher/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 \stepancher\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!

The Versions

20/05 2016

dev-master

9999999-dev

The comments module for Yii2 application.

  Sources   Download

BSD-3-Clause

The Requires

 

by Stepan Cherepanov

yii2 module yii 2 comments

01/03 2015

0.1.3

0.1.3.0

The comments module for Yii2-Start application.

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 module yii 2 comments yii2-start

13/02 2015

0.1.2

0.1.2.0

The comments module for Yii2-Start application.

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 module yii 2 comments yii2-start

08/01 2015

0.1.1

0.1.1.0

The comments module for Yii2-Start application.

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 module yii 2 comments yii2-start

13/10 2014

0.1.0

0.1.0.0

The comments module for Yii2-Start application.

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 module yii 2 comments yii2-start