bakaphp /
phalcon-api
| 1 | <?php |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 2 | |||
| 3 | namespace Gewaer\Providers; |
||
| 4 | |||
| 5 | use Phalcon\Di\ServiceProviderInterface; |
||
| 6 | use Phalcon\DiInterface; |
||
| 7 | |||
| 8 | class MailProvider implements ServiceProviderInterface |
||
| 9 | {
|
||
| 10 | /** |
||
| 11 | * @param DiInterface $container |
||
| 12 | */ |
||
| 13 | public function register(DiInterface $container) |
||
| 14 | {
|
||
| 15 | $config = $container->getShared('config');
|
||
| 16 | |||
| 17 | $container->setShared( |
||
| 18 | 'mail', |
||
| 19 | function () use ($config) {
|
||
| 20 | $mailer = new \Baka\Mail\Manager($config->email->toArray()); |
||
| 21 | return $mailer->createMessage(); |
||
| 22 | } |
||
| 23 | ); |
||
| 24 | } |
||
| 25 | } |
||
| 26 |