Module components

Hi Gurus. I’m just wondering how to add a components configuration on a yii2 module.

For example my module requires




    'components' => [

        'assetManager' => [

            'class' => 'yii\web\AssetManager',

            'forceCopy' => true,          

        ],

    ],



how do I properly implement it?

dnt get ur requirement u want to config ur components in config file

See: http://www.yiiframework.com/doc-2.0/guide-structure-modules.html

In the module init you can use this:




 \Yii::configure($this, require(__DIR__ . '/config.php'));



Then in the module root you create a config.php




<?php

return [

    'components' => [

        'assetManager' => [

            'class' => 'yii\web\AssetManager',

            'forceCopy' => true,          

        ],

    ],

];



Tell us if this works