-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathPageModule.php
62 lines (55 loc) · 1.37 KB
/
PageModule.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
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* @link http://www.yee-soft.com/
* @copyright Copyright (c) 2015 Taras Makitra
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
namespace yeesoft\page;
use Yii;
/**
* Page Module For Yee CMS
*
* @author Taras Makitra <[email protected]>
*/
class PageModule extends \yii\base\Module
{
/**
* Version number of the module.
*/
const VERSION = '0.1-a';
public $controllerNamespace = 'yeesoft\page\controllers';
public $viewList;
public $layoutList;
/**
* Default views and layouts
* Add more views and layouts in your main config file by calling the module
*
* Example:
*
* 'page' => [
* 'class' => 'yeesoft\page\PageModule',
* 'viewList' => [
* 'page' => 'View Label 1',
* 'page_test' => 'View Label 2',
* ],
* 'layoutList' => [
* 'main' => 'Layout Label 1',
* 'dark_layout' => 'Layout Label 2',
* ],
* ],
*/
public function init()
{
if (empty($this->viewList)) {
$this->viewList = [
'page' => Yii::t('yee', 'Page view')
];
}
if (empty($this->layoutList)) {
$this->layoutList = [
'main' => Yii::t('yee', 'Main layout')
];
}
parent::init();
}
}