Skip to content

Commit 5cdf33f

Browse files
author
Igor Chepurnoy
committed
add ability to set id for pjax
1 parent 691ae77 commit 5cdf33f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

widgets/Comment.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Yii;
66
use yii\base\InvalidConfigException;
77
use yii\base\Widget;
8+
use yii\helpers\ArrayHelper;
89
use yii\helpers\Json;
910
use yii2mod\comments\CommentAsset;
1011
use yii2mod\comments\Module;
@@ -85,7 +86,7 @@ public function init()
8586
throw new InvalidConfigException(Yii::t('yii2mod.comments', 'The "model" property must be set.'));
8687
}
8788

88-
$this->pjaxContainerId = 'comment-pjax-container-' . $this->getId();
89+
$this->pjaxContainerId = ArrayHelper::getValue($this->clientOptions, 'pjaxContainerId', 'comment-pjax-container-' . $this->getId());
8990
$this->entity = hash('crc32', get_class($this->model));
9091
$this->entityId = $this->model->{$this->entityIdAttribute};
9192

0 commit comments

Comments
 (0)