1 | <?php |
||
2 | |||
3 | namespace yii2mod\comments; |
||
4 | |||
5 | use Yii; |
||
6 | |||
7 | /** |
||
8 | * Class Module |
||
9 | * |
||
10 | * @package yii2mod\comments |
||
11 | */ |
||
12 | class Module extends \yii\base\Module |
||
13 | { |
||
14 | /** |
||
15 | * @var string the class name of the [[identity]] object |
||
16 | */ |
||
17 | public $userIdentityClass; |
||
18 | |||
19 | /** |
||
20 | * @var string the class name of the comment model object, by default its yii2mod\comments\models\CommentModel |
||
21 | */ |
||
22 | public $commentModelClass = 'yii2mod\comments\models\CommentModel'; |
||
23 | |||
24 | /** |
||
25 | * @var string the namespace that controller classes are in |
||
26 | */ |
||
27 | public $controllerNamespace = 'yii2mod\comments\controllers'; |
||
28 | |||
29 | /** |
||
30 | * @var bool when admin can edit comments on frontend |
||
31 | */ |
||
32 | public $enableInlineEdit = false; |
||
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | public function init() |
||
38 | { |
||
39 | parent::init(); |
||
40 | |||
41 | if (null === $this->userIdentityClass) { |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
42 | $this->userIdentityClass = Yii::$app->getUser()->identityClass; |
||
43 | } |
||
44 | } |
||
45 | } |
||
46 |