A
A
akula222018-04-07 10:20:02
Yii
akula22, 2018-04-07 10:20:02

How to include your config file in yii2?

I want to get my array of settings like in params.php in the console application, I don’t understand how to do it, I created the /config/accounts.php file
in the config, I connect it $accounts = require __DIR__ . '/accounts.php';
and then how to regist it in the application?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2018-04-07
@Maksclub

The web.php config pulls the rest:
https://github.com/yiisoft/yii2-app-basic/blob/mas...
The application pulls the web.php config:
https://github.com/yiisoft/yii2-app- basic/blob/mas...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question