Yii 2.0: yii2-comments

Let you add comments to any View

The preferred way to install this extension is through composer.

Either run

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

or add

"spanjeta/yii2-comments": "*"

to the require section of your composer.json file. Usage

Once the extension is installed, use mitration to install table

yii migrate/up --migrationPath=@spanjeta/comments/migrations

simply use it in your code by :

<?=   \spanjeta\comments\CommentsWidget::widget(['model'=>$model]); ?>

Total 2 comments

#18772 report it
shiv at 2015/01/04 09:52am

Do you have id in your posts model? It just the parameter 'id' is assumed in your model.

#18740 report it
zubair at 2014/12/22 11:08am
Where to add the last line of code

Hi I am trying to add your extension to my posts. So I have added the last line of your code <?= \spanjeta\comments\CommentsWidget::widget(['model'=>$model]); ?> to my view.php of posts. However i get an error saying"Getting unknown property: app\models\Posts::id".

Could you tell me where exactly should I add that last line.

Leave a comment

Please to leave your comment.

Create extension
No downloadable files yet