itsurka/yii2-simple-comment

一个简单的评论扩展。

安装: 34

依赖: 0

建议: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:yii2-extension

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

This package is not auto-updated.

Last update: 2024-09-24 01:17:47 UTC


README

正在开发中!请不要在生产环境中使用!

一个简单的评论扩展。

安装

  1. 下载扩展

安装此扩展的首选方法是通过 composer

运行以下命令之一

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

或者

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

将以下内容添加到您的 composer.json 文件的 require 部分。

  1. 从 yii2-simple-comment/migrations 文件夹应用迁移。

使用方法

扩展安装完成后,只需在您的代码中简单使用它即可

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