itsurka/yii2-simple-comment

A simple comment extension.

Installs: 34

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2015-02-02 20:35 UTC

This package is not auto-updated.

Last update: 2024-05-06 23:27:47 UTC


README

UNDER DEVELOPING! DO NOT USE IN PRODUCTION!

A simple comment extension.

Installation

  1. Download extension

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist itsurka/yii2-simple-comment "*"

or add

"itsurka/yii2-simple-comment": "*"

to the require section of your composer.json file.

  1. Apply migrations from yii2-simple-comment/migrations folder.

Usage

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

<?= SimpleComment::widget([
    'model'                => $model, // AR model for which will be displayed the comments widget.
    'author'               => $user, // AR model - comments author.
    'authorNameAttribute'  => 'username', // AR models name attribute.
    'authorNameAttribute'  => 'avatarUrl', // Avatar URL. Use this or $authorAvatarFunction param.
    'authorAvatarFunction' => 'getAvatarUrl', // To get avatar URL. Use this or $authorAvatarAttribute param.
    'authorAvatarWidth'    => '100',
    'authorAvatarHeight'   => '100',
]) ?>```