rmrevin / yii2-comments

Yii 2 comments extension
MIT License
52 stars 19 forks source link

rmrevin yii2-comments Unknown author #4

Closed nelli7 closed 9 years ago

nelli7 commented 9 years ago

Hello! When I add a comment it works fine, but it writes Unknown author. In data base "created_by" is filled correctly, 1, 2 etc.

Could you please explain how can I display username instead of Unknown author?

rmrevin commented 9 years ago

You should assign your model user interface "CommentatorInterface"

nelli7 commented 9 years ago

If I assign my model in "CommentatorInterface" , if I run composer install it will be broken? Or should I overwrite these methods in my own model "User" ? Thank you for the answer!

nelli7 commented 9 years ago

Okay, now I can get only one username for all comments. This method "public function getCommentatorName();" returns string, but there are many users that can comment,could you please tell me how can I get them all, if it returns string?)

rmrevin commented 9 years ago

@nelli7 You have anonymous comments? I'm afraid if this expansion will not help you. You will have to extend the functionality of their own.

nelli7 commented 9 years ago

I have view for Task. Registered users can leave comments in view of Tasks. And I am trying to get their usernames, in table comments we have created_by. created_by contains users id. And I thought that I can get their usernames somehow, but I can return only one user)