1 | <?php |
||
2 | |||
3 | /** |
||
4 | * @copyright Bluz PHP Team |
||
5 | * @link https://github.com/bluzphp/skeleton |
||
6 | */ |
||
7 | |||
8 | /** |
||
9 | * @namespace |
||
10 | */ |
||
11 | |||
12 | namespace Application\Layout\Helper; |
||
13 | |||
14 | use Application\Users; |
||
15 | |||
16 | return |
||
17 | /** |
||
18 | * Get profile link by email user |
||
19 | * |
||
20 | * @param string $email |
||
21 | * @param array $attributes |
||
22 | * |
||
23 | * @return string |
||
24 | */ |
||
25 | function ($email, array $attributes = []) { |
||
26 | /** |
||
27 | * @var \Application\Users\Row $user |
||
28 | */ |
||
29 | $row = Users\Table::findRow(['email' => $email]); |
||
30 | |||
31 | if (!empty($row)) { |
||
32 | $attributes['data-id'] = $row->id; |
||
33 | return $this->ahref($row->login, ['users', 'profile'], $attributes); |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
![]() |
|||
34 | } |
||
35 | return ''; |
||
36 | }; |
||
37 |