コード例 #1
0
 public function actionEdit()
 {
     $id = $this->helpGquery('id', '0');
     $comm = new Comment();
     $comment = $comm->getComment(['id' => $id]);
     $comment['content_arr'] = explode(',', $comment['content']);
     $params = ['comment' => $comment];
     return $this->render('edit', $params);
 }
コード例 #2
0
ファイル: CommentTest.php プロジェクト: richardcj/Blog-Yii2
 public function testGetAuthorByComment()
 {
     $comment = $this->commentModel->getComment(2);
     $this->assertInstanceOf('common\\models\\User', $comment->getAuthor()->one());
 }