Skip to content

Commit

Permalink
Update Module.php
Browse files Browse the repository at this point in the history
Signed-off-by: ArchBlood <[email protected]>
  • Loading branch information
ArchBlood authored Apr 3, 2024
1 parent b6c299b commit 2093403
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,31 @@ class Module extends BaseModule
*/
public $resourcesPath = 'resources';

// Define the namespace for web controllers
public $controllerNamespace = 'humhub\modules\composer\controllers';

// Define the namespace for console commands
public $commandNamespace = 'humhub\modules\composer\commands';

public function init()
{
parent::init();
if (Yii::$app instanceof \yii\console\Application) {
// Set controller namespace to default web controllers namespace for console application
$this->controllerNamespace = 'humhub\modules\composer\controllers';
// Define console command mappings
$this->controllerMap = [
'theme' => 'humhub\modules\composer\commands\ThemeController',
'refresh' => 'humhub\modules\composer\commands\RefreshAssetsController',
];
}
}

public function actions()
{
return [
'theme/compile' => 'composer\commands\ThemeController',
'refresh-assets' => 'composer\commands\RefreshAssetsController',
'theme/compile' => 'humhub\modules\composer\commands\ThemeController',
'refresh-assets' => 'humhub\modules\composer\commands\RefreshAssetsController',
];
}

Expand Down

0 comments on commit 2093403

Please sign in to comment.