当前位置: 首页>>代码示例>>PHP>>正文


PHP Mailer::setContainer方法代码示例

本文整理汇总了PHP中Illuminate\Mail\Mailer::setContainer方法的典型用法代码示例。如果您正苦于以下问题:PHP Mailer::setContainer方法的具体用法?PHP Mailer::setContainer怎么用?PHP Mailer::setContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Mail\Mailer的用法示例。


在下文中一共展示了Mailer::setContainer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setMailerDependencies

 /**
  * Set a few dependencies on the mailer instance.
  *
  * @param  \Illuminate\Mail\Mailer  $mailer
  * @param  \Illuminate\Foundation\Application  $app
  * @return void
  */
 protected function setMailerDependencies($mailer, $app)
 {
     $mailer->setContainer($app);
     if ($app->bound('queue')) {
         $mailer->setQueue($app['queue']);
     }
 }
开发者ID:jarnovanleeuwen,项目名称:framework,代码行数:14,代码来源:MailServiceProvider.php

示例2: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->registerSwiftMailer();
     $this->app['mailer'] = $this->app->share(function ($app) {
         // Once we have create the mailer instance, we will set a container instance
         // on the mailer. This allows us to resolve mailer classes via containers
         // for maximum testability on said classes instead of passing Closures.
         $mailer = new Mailer($app['view'], $app['swift.mailer']);
         $mailer->setLogger($app['log'])->setQueue($app['queue']);
         $mailer->setContainer($app);
         // If a "from" address is set, we will set it on the mailer so that all mail
         // messages sent by the applications will utilize the same "from" address
         // on each one, which makes the developer's life a lot more convenient.
         $from = $app['config']['mail.from'];
         if (is_array($from) and isset($from['address'])) {
             $mailer->alwaysFrom($from['address'], $from['name']);
         }
         // Here we will determine if the mailer should be in "pretend" mode for this
         // environment, which will simply write out e-mail to the logs instead of
         // sending it over the web, which is useful for local dev enviornments.
         $pretend = $app['config']->get('mail.pretend', false);
         $mailer->pretend($pretend);
         return $mailer;
     });
 }
开发者ID:Thomvh,项目名称:turbine,代码行数:30,代码来源:MailServiceProvider.php

示例3: setMailerDependencies

 /**
  * Set a few dependencies on the mailer instance.
  *
  * @param  \Illuminate\Mail\Mailer  $mailer
  * @param  \Illuminate\Foundation\Application  $app
  * @return void
  */
 protected function setMailerDependencies($mailer, $app)
 {
     $mailer->setContainer($app);
     if ($app->bound('log')) {
         $mailer->setLogger($app['log']->getMonolog());
     }
     if ($app->bound('queue')) {
         $mailer->setQueue($app['queue.connection']);
     }
 }
开发者ID:AlexCutts,项目名称:framework,代码行数:17,代码来源:MailServiceProvider.php

示例4: setMailerDependencies

 /**
  * Set a few dependencies on the mailer instance.
  *
  * @param  \Illuminate\Mail\Mailer  $mailer
  * @param  \Illuminate\Foundation\Application  $app
  * @return void
  */
 protected function setMailerDependencies($mailer, $app)
 {
     $mailer->setContainer($app);
     if ($app->bound('Psr\\Log\\LoggerInterface')) {
         $mailer->setLogger($app->make('Psr\\Log\\LoggerInterface'));
     }
     if ($app->bound('queue')) {
         $mailer->setQueue($app['queue.connection']);
     }
 }
开发者ID:EnmanuelCode,项目名称:backend-laravel,代码行数:17,代码来源:MailServiceProvider.php

示例5: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->registerSwiftMailer();
     $this->app['mailer'] = $this->app->share(function ($app) {
         // Once we have create the mailer instance, we will set a container instance
         // on the mailer. This allows us to resolve mailer classes via containers
         // for maximum testability on said classes instead of passing Closures.
         $mailer = new Mailer($app['view'], $app['swift.mailer']);
         $mailer->setLogger($app['log'])->setQueue($app['queue']);
         $mailer->setContainer($app);
         $from = $app['config']['mail.from'];
         // If a "from" address is set, we will set it on the mailer so that all mail
         // messages sent by the applications will utilize the same "from" address
         // on each one, which makes the developer's life a lot more convenient.
         if (is_array($from) and isset($from['address'])) {
             $mailer->alwaysFrom($from['address'], $from['name']);
         }
         return $mailer;
     });
 }
开发者ID:brucewu16899,项目名称:laravel-admin-panel,代码行数:25,代码来源:MailServiceProvider.php

示例6: setContainer

 /**
  * Set the IoC container instance.
  *
  * @param \Illuminate\Contracts\Container\Container $container
  * @return void 
  * @static 
  */
 public static function setContainer($container)
 {
     \Illuminate\Mail\Mailer::setContainer($container);
 }
开发者ID:satriashp,项目名称:tour,代码行数:11,代码来源:_ide_helper.php


注:本文中的Illuminate\Mail\Mailer::setContainer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。