|
5 | 5 | use UIAwesome\Html\{Graphic\Svg};
|
6 | 6 | use yii\helpers\Html;
|
7 | 7 |
|
8 |
| -?> |
| 8 | +$socialLinks = [ |
| 9 | + ['icon' => 'github.svg', 'url' => 'https://github.com/yiisoft', 'title' => 'GitHub'], |
| 10 | + ['icon' => 'slack.svg', 'url' => 'https://join.slack.com/t/yii/shared_invite/...', 'title' => 'Slack'], |
| 11 | + ['icon' => 'facebook.svg', 'url' => 'https://www.facebook.com/groups/yiitalk/', 'title' => 'Facebook'], |
| 12 | + ['icon' => 'twitter.svg', 'url' => 'https://twitter.com/yiiframework', 'title' => 'Twitter'], |
| 13 | + ['icon' => 'telegram.svg', 'url' => 'https://t.me/yii_framework_in_english', 'title' => 'Telegram'], |
| 14 | +]; |
9 | 15 |
|
10 |
| -<?= Html::a( |
11 |
| - Svg::widget() |
12 |
| - ->attributes(['height' => '24', 'width' => '24']) |
13 |
| - ->filePath(Yii::getAlias('@npm/bootstrap-icons/icons/github.svg')) |
14 |
| - ->render(), |
15 |
| - 'https://github.com/yiisoft', |
16 |
| - [ |
17 |
| - 'class' => 'd-none d-sm-block d-md-block d-lg-block d-xl-block text-muted hover:text-dark text-decoration-none ms-3', |
18 |
| - 'rel' => 'noopener', |
19 |
| - 'title' => 'GitHub', |
20 |
| - ], |
21 |
| -) ?> |
22 |
| -<?= Html::a( |
23 |
| - Svg::widget() |
24 |
| - ->attributes(['height' => '24', 'width' => '24']) |
25 |
| - ->filePath(Yii::getAlias('@npm/bootstrap-icons/icons/slack.svg')) |
26 |
| - ->render(), |
27 |
| - 'https://join.slack.com/t/yii/shared_invite/enQtMzQ4MDExMDcyNTk2LTc0NDQ2ZTZhNjkzZDgwYjE4YjZlNGQxZjFmZDBjZTU3NjViMDE4ZTMxNDRkZjVlNmM1ZTA1ODVmZGUwY2U3NDA', |
28 |
| - [ |
29 |
| - 'class' => 'd-none d-sm-block d-md-block d-lg-block d-xl-block text-muted hover:text-dark text-decoration-none ms-3', |
30 |
| - 'rel' => 'noopener', |
31 |
| - 'title' => 'Slack', |
32 |
| - ], |
33 |
| -) ?> |
34 |
| -<?= Html::a( |
35 |
| - Svg::widget() |
36 |
| - ->attributes(['height' => '24', 'width' => '24']) |
37 |
| - ->filePath(Yii::getAlias('@npm/bootstrap-icons/icons/facebook.svg')) |
38 |
| - ->render(), |
39 |
| - 'https://www.facebook.com/groups/yiitalk/', |
40 |
| - [ |
41 |
| - 'class' => 'd-none d-sm-block d-md-block d-lg-block d-xl-block text-muted hover:text-dark text-decoration-none ms-3', |
42 |
| - 'rel' => 'noopener', |
43 |
| - 'title' => 'Facebook', |
44 |
| - ], |
45 |
| -) ?> |
46 |
| -<?= Html::a( |
47 |
| - Svg::widget() |
48 |
| - ->attributes(['height' => '24', 'width' => '24']) |
49 |
| - ->filePath(Yii::getAlias('@npm/bootstrap-icons/icons/twitter.svg')) |
50 |
| - ->render(), |
51 |
| - 'https://twitter.com/yiiframework', |
52 |
| - [ |
53 |
| - 'class' => 'd-none d-sm-block d-md-block d-lg-block d-xl-block text-muted hover:text-dark text-decoration-none ms-3', |
54 |
| - 'rel' => 'noopener', |
55 |
| - 'title' => 'Twitter', |
56 |
| - ], |
57 |
| -) ?> |
58 |
| -<?= Html::a( |
59 |
| - Svg::widget() |
60 |
| - ->attributes(['height' => '24', 'width' => '24']) |
61 |
| - ->filePath(Yii::getAlias('@npm/bootstrap-icons/icons/telegram.svg')) |
62 |
| - ->render(), |
63 |
| - 'https://t.me/yii_framework_in_english', |
64 |
| - [ |
65 |
| - 'class' => 'd-none d-sm-block d-md-block d-lg-block d-xl-block text-muted hover:text-dark text-decoration-none ms-3', |
66 |
| - 'rel' => 'noopener', |
67 |
| - 'title' => 'Telegram', |
68 |
| - ], |
69 |
| -) ?> |
| 16 | +foreach ($socialLinks as $link): ?> |
| 17 | + <?= Html::a( |
| 18 | + Svg::widget() |
| 19 | + ->attributes(['height' => '24', 'width' => '24']) |
| 20 | + ->filePath(Yii::getAlias('@npm/bootstrap-icons/icons/' . $link['icon'])) |
| 21 | + ->render(), |
| 22 | + $link['url'], |
| 23 | + [ |
| 24 | + 'class' => 'd-none d-sm-block d-md-block d-lg-block d-xl-block text-muted text-decoration-none ms-3', |
| 25 | + 'rel' => 'noopener', |
| 26 | + 'title' => $link['title'], |
| 27 | + ], |
| 28 | + ) ?> |
| 29 | +<?php endforeach; |
0 commit comments