Layer: Core · Source: lib/core/LocaleRouter.php:7 (lines 7–112)
class LocaleRouter
No parent, interface or trait. This is a root type.
None.
| Visibility | Type | Name | Default | Line |
|---|---|---|---|---|
private | (untyped) | $routes | [] | 9 |
private | (untyped) | $detector | 10 | |
private | (untyped) | $availableLocales | [] | 11 |
| Visibility | Method | Summary | Line |
|---|---|---|---|
| public | __construct() | (undocumented) | 13 |
| private | registerDefaultRoutes() | (undocumented) | 20 |
| public | addRoute() | (undocumented) | 34 |
| public | extractLocale() | (undocumented) | 62 |
| public | stripLocalePrefix() | (undocumented) | 75 |
| public | buildUrl() | (undocumented) | 85 |
| public | buildCurrentUrl() | (undocumented) | 93 |
| public | getRoutes() | (undocumented) | 98 |
| public | hasLocalePrefix() | (undocumented) | 103 |
| public | getDetector() | (undocumented) | 108 |
public function __construct(array $detectorSettings = [])
lines 13–18 (6)
| Parameter | Type | Default | Description |
|---|---|---|---|
$detectorSettings | array | [] | none |
private function registerDefaultRoutes(): void
lines 20–32 (13)
Takes no parameters.
Returns: void
public function addRoute(string $name, string $pattern): void
lines 34–37 (4)
| Parameter | Type | Default | Description |
|---|---|---|---|
$name | string | required | none |
$pattern | string | required | none |
Returns: void
public function extractLocale(string $path): ?string
lines 62–73 (12)
| Parameter | Type | Default | Description |
|---|---|---|---|
$path | string | required | none |
Returns: ?string
public function stripLocalePrefix(string $path): string
lines 75–83 (9)
| Parameter | Type | Default | Description |
|---|---|---|---|
$path | string | required | none |
Returns: string
public function buildUrl(string $path, ?string $locale = null): string
lines 85–91 (7)
| Parameter | Type | Default | Description |
|---|---|---|---|
$path | string | required | none |
$locale | ?string | null | none |
Returns: string
public function buildCurrentUrl(string $path): string
lines 93–96 (4)
| Parameter | Type | Default | Description |
|---|---|---|---|
$path | string | required | none |
Returns: string
public function getRoutes(): array
lines 98–101 (4)
Takes no parameters.
Returns: array
public function hasLocalePrefix(string $path): bool
lines 103–106 (4)
| Parameter | Type | Default | Description |
|---|---|---|---|
$path | string | required | none |
Returns: bool
public function getDetector(): LocaleDetector
lines 108–111 (4)
Takes no parameters.
Returns: ''LocaleDetector''
This page is generated from source by 'tools/gendoc'. Edits will be overwritten.