-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
|
||
use Yii; | ||
use yii\base\Widget; | ||
use app\widgets\comment\models\Comment as CommentModel; | ||
|
||
/** | ||
* @author Shiyang <[email protected]> | ||
|
@@ -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'], | ||
|
@@ -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.')); | ||
|