title: Yii2: How to access module variable inside the module itself?
body: <p>I'm creating a Yii2 Module , 
  in this module I set a variable upload_path.
  now I'm trying to access this variable from a behavior inside this module using </p>
  
  <pre><code> module = MyModuleClass::getInstance();
  </code></pre>
  
  <p>and I get null ,
  the only way to access this variable is by setting the config :</p>
  
  <pre><code>'modules' =&gt; [
      'w_forms' =&gt; [
          'class' =&gt; 'wardany\dform\DynamicForm',
          'upload_path'=&gt; "@frontend/web/uploads",
          'upload_url'=&gt; "/uploads",
      ],
  ]
  
  Yii::$app-&gt;getModule('w_forms')-&gt;upload_path
  </code></pre>
  
  <p>but I think this is not good cuz user may change the Id 'w_forms'</p>