adzayko
            (Storytellercontact)
          
          
          
              
              
          1
          
         
        
          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?
         
        
          
        
           
           
           
         
         
            
            
          
       
      
        
          
          
            rupsk1607
            (Webin2015)
          
          
          
              
              
          2
          
         
        
          
dnt get ur requirement u want to config ur components in config file
         
        
        
           
           
           
         
         
            
            
          
       
      
        
          
          
            realtebo
            (Mirkotebaldi)
          
          
          
              
              
          3
          
         
        
          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