Access variables set in config/main.php or config/main-local.php

Searched this everywhere but can’t seem to find an actual answer. Seems like post answers are for params.php or params-local.php. Anyone know how I can access variables set in my config/main.php or config/main-local.php

You mean regular variables that aren’t part of config array returned? You can’t access them.

So, I have the following in my main.php – So there’s no way to access the what is set as my smtp host?

return [
‘mailer’ => [
‘class’ => ‘yii\swiftmailer\Mailer’,
‘viewPath’ => ‘@common/mail’,
‘useFileTransport’ => false,
‘transport’ => [
‘class’ => ‘Swift_SmtpTransport’,
‘host’ => 'some.host.com,
‘username’ => 'someusername,
‘password’ => ‘somepassword’,
‘port’ => ‘587’,
‘encryption’ => ‘tls’,
],
],
],
];

Set it from params if you want to reuse it.