-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathPostModule.php
More file actions
76 lines (61 loc) · 1.56 KB
/
Copy pathPostModule.php
File metadata and controls
76 lines (61 loc) · 1.56 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* @link http://www.yee-soft.com/
* @copyright Copyright (c) 2015 Taras Makitra
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
namespace yeesoft\post;
use Yii;
/**
* Post Module For Yee CMS
*
* @author Taras Makitra <makitrataras@gmail.com>
*/
class PostModule extends \yii\base\Module
{
/**
* Version number of the module.
*/
const VERSION = '0.1-a';
/**
* Table aliases
*
* @var string
*/
public $post_table = '{{%post}}';
public $controllerNamespace = 'yeesoft\post\controllers';
public $viewList;
public $layoutsList;
public function init()
{
/**
* Default views and layouts
* Add more views and layouts in your main config file by calling the module
*
* Example:
*
* 'post' => [
* 'class' => 'yeesoft\post\PostModule',
* 'viewList' => [
* 'post' => 'View Label 1',
* 'post_test' => 'View Label 2',
* ],
* 'layoutsList' => [
* 'main' => 'Layout Label 1',
* 'dark_layout' => 'Layout Label 2',
* ],
* ],
*/
if(empty($this->viewList)){
$this->viewList = [
'post' => Yii::t('yee', 'Post view')
];
}
if(empty($this->layoutsList)){
$this->viewList = [
'main' => Yii::t('yee', 'Main layout')
];
}
parent::init();
}
}