public getModuleId ( ) : string | ||
리턴 | string | the controller ID (without the module ID prefix) |
public function getModuleId()
{
if (!$this->moduleNs) {
$controllerNs = \yii\helpers\StringHelper::dirname(ltrim($this->controllerClass, '\\'));
$this->moduleNs = \yii\helpers\StringHelper::dirname(ltrim($controllerNs, '\\'));
}
return \yii\helpers\StringHelper::basename($this->moduleNs);
}