Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
shi-yang committed Dec 8, 2016
1 parent 9d9aa75 commit 227400d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/widgets/comment/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use Yii;
use yii\base\Widget;
use app\widgets\comment\models\Comment as CommentModel;

/**
* @author Shiyang <[email protected]>
Expand Down Expand Up @@ -43,7 +44,7 @@ public function init()

public function run()
{
$commentList = \app\widgets\comment\models\Comment::getCommentList($this->entity, $this->entityId);
$commentList = CommentModel::getCommentList($this->entity, $this->entityId);
$newComment = $this->newComment();
return $this->render('comment', [
'commentList' => $commentList['result'],
Expand All @@ -58,7 +59,7 @@ public function run()
*/
public function newComment()
{
$newComment = new \app\widgets\comment\models\Comment();
$newComment = new CommentModel;
if ($newComment->load(Yii::$app->request->post())) {
if (Yii::$app->user->isGuest) {
Yii::$app->getSession()->setFlash('info', Yii::t('app', 'You need to sign in or sign up before continuing.'));
Expand Down

0 comments on commit 227400d

Please sign in to comment.