helpers.php ➔ t_route()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 4
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
if (!function_exists('t_route')) {
5
    /**
6
     * Возвращает переведенный именованный маршрут
7
     *
8
     * @param string $name
9
     * @param array $parameters
10
     * @param string $local
11
     * @param boolean $absolute
12
     * @return string
13
     */
14
    function t_route(string $name, $parameters = [], $local = '', $absolute = true): string
15
    {
16
        if (empty($local)) $local = app('localizer')->getLocale();
17
        $name = app('localizer')->getNamePrefix() . $local . '.' . $name;
18
19
        return route($name, $parameters, $absolute);
20
    }
21
}