yii\base\Module::hasModule PHP Метод

hasModule() публичный Метод

This method supports checking the existence of both child and grand child modules.
public hasModule ( string $id ) : boolean
$id string module ID. For grand child modules, use ID path relative to this module (e.g. `admin/content`).
Результат boolean whether the named module exists. Both loaded and unloaded modules are considered.
    public function hasModule($id)
    {
        if (($pos = strpos($id, '/')) !== false) {
            // sub-module
            $module = $this->getModule(substr($id, 0, $pos));
            return $module === null ? false : $module->hasModule(substr($id, $pos + 1));
        } else {
            return isset($this->_modules[$id]);
        }
    }