|
|
@ -126,15 +126,9 @@ abstract class Module extends Component |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function __construct($id, $parent = null, $config = []) |
|
|
|
public function __construct($id, $parent = null, $config = []) |
|
|
|
{ |
|
|
|
{ |
|
|
|
parent::__construct($config); |
|
|
|
|
|
|
|
$this->id = $id; |
|
|
|
$this->id = $id; |
|
|
|
$this->module = $parent; |
|
|
|
$this->module = $parent; |
|
|
|
if ($this->controllerNamespace === null) { |
|
|
|
parent::__construct($config); |
|
|
|
$class = get_class($this); |
|
|
|
|
|
|
|
if (($pos = strrpos($class, '\\')) !== false) { |
|
|
|
|
|
|
|
$this->controllerNamespace = substr($class, 0, $pos) . '\\controllers'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -178,6 +172,12 @@ abstract class Module extends Component |
|
|
|
public function init() |
|
|
|
public function init() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$this->preloadComponents(); |
|
|
|
$this->preloadComponents(); |
|
|
|
|
|
|
|
if ($this->controllerNamespace === null) { |
|
|
|
|
|
|
|
$class = get_class($this); |
|
|
|
|
|
|
|
if (($pos = strrpos($class, '\\')) !== false) { |
|
|
|
|
|
|
|
$this->controllerNamespace = substr($class, 0, $pos) . '\\controllers'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|