Commit a8e21a4c0ca92f320ccec127b0c465fb6a8d00be

Authored by Alexey Boroda
1 parent 6af5dbe3

-Comments configured

frontend/controllers/SiteController.php
@@ -3,8 +3,8 @@ @@ -3,8 +3,8 @@
3 3
4 use artbox\core\models\Feedback; 4 use artbox\core\models\Feedback;
5 use artbox\core\models\Page; 5 use artbox\core\models\Page;
6 - use artbox\webcomment\models\CommentModel;  
7 use common\models\Settings; 6 use common\models\Settings;
  7 + use frontend\models\CommentPage;
8 use Yii; 8 use Yii;
9 use yii\filters\VerbFilter; 9 use yii\filters\VerbFilter;
10 use yii\swiftmailer\Mailer; 10 use yii\swiftmailer\Mailer;
@@ -174,7 +174,7 @@ @@ -174,7 +174,7 @@
174 174
175 public function actionComments() 175 public function actionComments()
176 { 176 {
177 - $model = new CommentModel( 177 + $model = new CommentPage(
178 [ 178 [
179 'id' => 1, 179 'id' => 1,
180 ] 180 ]
frontend/models/CommentPage.php
@@ -2,14 +2,14 @@ @@ -2,14 +2,14 @@
2 2
3 namespace frontend\models; 3 namespace frontend\models;
4 4
5 - use yii\base\Object; 5 + use yii\base\Model;
6 6
7 /** 7 /**
8 * Class CommentPage 8 * Class CommentPage
9 * 9 *
10 * @package frontend\models 10 * @package frontend\models
11 */ 11 */
12 - class CommentPage extends Object 12 + class CommentPage extends Model
13 { 13 {
14 public $id; 14 public $id;
15 - }  
16 \ No newline at end of file 15 \ No newline at end of file
  16 + }
frontend/views/site/comments.php
@@ -16,18 +16,19 @@ @@ -16,18 +16,19 @@
16 <?php 16 <?php
17 echo CommentWidget::widget( 17 echo CommentWidget::widget(
18 [ 18 [
19 - 'model' => $model,  
20 - 'display_name' => 'name',  
21 - 'reply' => true,  
22 - 'delete' => false,  
23 - 'more' => [ 19 + 'model' => $model,
  20 + 'display_name' => 'name',
  21 + 'entityIdAttribute' => 'id',
  22 + 'reply' => true,
  23 + 'delete' => false,
  24 + 'more' => [
24 'show_' => true, 25 'show_' => true,
25 'key' => 2, 26 'key' => 2,
26 ], 27 ],
27 - 'formView' => '@frontend/views/site/comment/artbox_comment_form',  
28 - 'listView' => '@frontend/views/site/comment/artbox_comment_list',  
29 - 'replyView' => '@frontend/views/site/comment/artbox_comment_reply',  
30 - 'itemView' => '@frontend/views/site/comment/artbox_comment_item', 28 + 'formView' => '@frontend/views/site/comment/artbox_comment_form',
  29 + 'listView' => '@frontend/views/site/comment/artbox_comment_list',
  30 + 'replyView' => '@frontend/views/site/comment/artbox_comment_reply',
  31 + 'itemView' => '@frontend/views/site/comment/artbox_comment_item',
31 ] 32 ]
32 ); 33 );
33 ?> 34 ?>