forked from pixelhumain/citizenToolKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CitizentoolkitModule.php
55 lines (49 loc) · 1.28 KB
/
CitizentoolkitModule.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
<?php
/**
* Communect Module
*
* @author Tibor Katelbach <[email protected]>
* @version 0.0.3
*
*/
//prevents the CTK to be executable
//when uncommented the CTK can be used just like a module and controllers accessed directly
/*
class CitizentoolkitModule extends CWebModule
{
public function init()
{
// this method is called when the module is being created
// you may place code here to customize the module or the application
Yii::setPathOfAlias('citizenToolKit', dirname(__FILE__));
Yii::app()->setComponents(array(
'errorHandler'=>array(
'errorAction'=>'/'.$this->id.'/error'
)
));
$this->setImport(array(
$this->id.'.models.*',
$this->id.'.components.*',
$this->id.'.messages.*',
));
}
public function beforeControllerAction($controller, $action)
{
if (parent::beforeControllerAction($controller, $action))
{
// this method is called before any module controller action is performed
// you may place customized code here
return true;
}
else
return false;
}
private $_assetsUrl;
public function getAssetsUrl()
{
if ($this->_assetsUrl === null)
$this->_assetsUrl = Yii::app()->getAssetManager()->publish(
Yii::getPathOfAlias($this->id.'.assets') );
return $this->_assetsUrl;
}
}*/