Commit a8e21a4c0ca92f320ccec127b0c465fb6a8d00be
1 parent
6af5dbe3
-Comments configured
Showing
3 changed files
with
15 additions
and
14 deletions
Show diff stats
frontend/controllers/SiteController.php
| ... | ... | @@ -3,8 +3,8 @@ |
| 3 | 3 | |
| 4 | 4 | use artbox\core\models\Feedback; |
| 5 | 5 | use artbox\core\models\Page; |
| 6 | - use artbox\webcomment\models\CommentModel; | |
| 7 | 6 | use common\models\Settings; |
| 7 | + use frontend\models\CommentPage; | |
| 8 | 8 | use Yii; |
| 9 | 9 | use yii\filters\VerbFilter; |
| 10 | 10 | use yii\swiftmailer\Mailer; |
| ... | ... | @@ -174,7 +174,7 @@ |
| 174 | 174 | |
| 175 | 175 | public function actionComments() |
| 176 | 176 | { |
| 177 | - $model = new CommentModel( | |
| 177 | + $model = new CommentPage( | |
| 178 | 178 | [ |
| 179 | 179 | 'id' => 1, |
| 180 | 180 | ] | ... | ... |
frontend/models/CommentPage.php
| ... | ... | @@ -2,14 +2,14 @@ |
| 2 | 2 | |
| 3 | 3 | namespace frontend\models; |
| 4 | 4 | |
| 5 | - use yii\base\Object; | |
| 5 | + use yii\base\Model; | |
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Class CommentPage |
| 9 | 9 | * |
| 10 | 10 | * @package frontend\models |
| 11 | 11 | */ |
| 12 | - class CommentPage extends Object | |
| 12 | + class CommentPage extends Model | |
| 13 | 13 | { |
| 14 | 14 | public $id; |
| 15 | - } | |
| 16 | 15 | \ No newline at end of file |
| 16 | + } | ... | ... |
frontend/views/site/comments.php
| ... | ... | @@ -16,18 +16,19 @@ |
| 16 | 16 | <?php |
| 17 | 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 | 25 | 'show_' => true, |
| 25 | 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 | ?> | ... | ... |