title: Yii2 params access within local config file in common directory
body: <p>I'm using <code>Yii2</code> advanced template,
  I want to access <code>params.php</code> in <code>main-local.php</code> file,
  I called this ways:</p>
  
  <p><strong>main-local.php:</strong></p>
  
  <pre><code>'mailer' =&gt; [
              'class' =&gt; 'myClass',
               'apikey' =&gt; \Yii::$app-&gt;params['mandrill_api_key'],
               'viewPath' =&gt; '@common/mail',            
          ],
  </code></pre>
  
  <p>and I have stored this <code>mandrill_api_key</code> in <code>params.php</code></p>
  
  <p><strong>params.php:</strong></p>
  
  <pre><code>&lt;?php
  return [
      'adminEmail' =&gt; 'admin@example.com',
      'supportEmail' =&gt; 'support@example.com',
      'user.passwordResetTokenExpire' =&gt; 3600,
       'mandrill_api_key' =&gt; 'mykey'
  ];
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <blockquote>
    <p>Notice: Trying to get property of non-object in C:\xampp\htdocs\myproject\common\config\main-local.php on line 25</p>
  </blockquote>
  
  <p>What should I do to access these parameters?</p>