O
O
Orbb2018-07-05 00:21:38
Yii
Orbb, 2018-07-05 00:21:38

How to move the Yii2 configuration to the database?

Sobsna, subject.
Basic application, interested in moving the configuration database from @app/config/web.php
More specifically, redefining the login: password of mail in Swift Mailer when working via smtp. I tried using Yii->app->components, but as expected, the data from the config has already passed to the mailer class when the application was loaded, so redefining them did not give anything.
Well, in general, it would be interesting to see how to put other component configs into the database, not just the mailer.
Maybe the question was formulated incorrectly, I will indicate the goal: to store some data in the database so that it is possible to edit in the admin panel.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-07-05
@webinar

Create your own component that will use yii\swiftmailer\Mailer, but will crawl into the database before sending.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question