How to execute command in sub folders

I have created a RbacController in a module which extends yii\console\Controller in the following folder:

frontend/modules/foo/bar/commands/RbacController.php

The controller has the following namespace:

frontend\modules\foo\bar\commands\RbacController

It has 2 commands; actionAdd and actionRemove.

I’ve tried lots of things see bellow, but no success




php yii bar/rbac/add

Error: Unknown command "bar/rbac/add".

php yii foo/bar/rbac/add

Error: Unknown command "foo/bar/rbac/add".

php yii modules/foo/bar/rbac/add

Error: Unknown command "modules/foo/bar/rbac/add".

php yii frontend/modules/foo/bar/rbac/add

Error: Unknown command "frontend/modules/foo/bar/rbac/add".



How can I execute it?

No one?

Is there an other way I could accomplish this?

I resolved the issue by updating my console config file:




'modules' => [

        'bar' => [

            'class' => frontend\modules\foo\bar\Module::className(),

            'controllerNamespace' => 'frontend\modules\foo\bar\commands'

        ]

]