Total Complexity | 4 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class HelloController extends Controller |
||
8 | { |
||
9 | public function actionIndex($name = 'World') |
||
12 | } |
||
13 | |||
14 | public function actionMail($to, $name = 'Foo') |
||
15 | { |
||
16 | $mailer = Yii::$app->getMailer(); |
||
17 | $sent = $mailer->compose('hello', ['name' => $name]) |
||
18 | ->setTo($to) |
||
19 | ->setFrom(Yii::$app->get('settingManager')->get('mailer.username')) |
||
20 | ->setSubject('Hello') |
||
21 | ->send(); |
||
22 | if (!$sent) { |
||
23 | $this->stdout('Send failure' . PHP_EOL); |
||
24 | return; |
||
25 | } |
||
26 | |||
27 | $this->stdout('Sent successfully' . PHP_EOL); |
||
28 | } |
||
29 | |||
30 | public function actionJob($name = 'World') |
||
35 | } |
||
36 | } |
||
37 |