I use the extended Yii2 template, I want to access params.php in the main-local.php file, I called it ways:
Main-local.php:
'mailer' => [ 'class' => 'myClass', 'apikey' => \Yii::$app->params['mandrill_api_key'], 'viewPath' => '@common/mail', ],
and I saved this mandrill_api_key in params.php
params.php:
<?php return [ 'adminEmail' => ' admin@example.com ', 'supportEmail' => ' support@example.com ', 'user.passwordResetTokenExpire' => 3600, 'mandrill_api_key' => 'mykey' ];
I get this error:
Note. Trying to get a non-object property in C: \ xampp \ htdocs \ myproject \ common \ config \ main-local.php on line 25
What should I do to access these options?
yii2 yii2-advanced-app
Muhammad Shahzad
source share