-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModule.php
49 lines (40 loc) · 1.03 KB
/
Module.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
namespace yii2mod\comments;
use Yii;
use yii2mod\comments\models\CommentModel;
/**
* Class Module
* @package yii2mod\comments
*/
class Module extends \yii\base\Module
{
/**
* @var string module name
*/
public static $name = 'comment';
/**
* @var string the class name of the [[identity]] object.
*/
public $userIdentityClass;
/**
* @var string the class name of the comment model object, by default its yii2mod\comments\models\CommentModel::className();
*/
public $commentModelClass;
/**
* @var string the namespace that controller classes are in.
*/
public $controllerNamespace = 'yii2mod\comments\controllers';
/**
* @inheritdoc
*/
public function init()
{
if (empty($this->userIdentityClass)) {
$this->userIdentityClass = Yii::$app->getUser()->identityClass;
}
if (empty($this->commentModelClass)) {
$this->commentModelClass = CommentModel::className();
}
parent::init();
}
}