Conditions | 3 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function yandexToken(): ?string |
||
27 | { |
||
28 | $cfg = App::$Properties->getAll('Yandex'); |
||
29 | |||
30 | $model = new FormYandexToken($cfg); |
||
|
|||
31 | if ($model->send() && $model->validate()) { |
||
32 | $model->make(); |
||
33 | App::$Session->getFlashBag()->add('success', __('Token saved successful. Valid until: %date%', [ |
||
34 | 'date' => Date::convertToDatetime(time() + $model->expires, Date::FORMAT_TO_DAY) |
||
35 | ])); |
||
36 | $this->response->redirect('main/yandexcounter'); |
||
37 | } |
||
38 | |||
39 | return $this->view->render('main/yandex_token', [ |
||
40 | 'model' => $model |
||
41 | ]); |
||
43 | } |